package com.ymatou.iapi.reachpromotion.testcase;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.marketingmanage.parameter.CreateSellerPromotionBean;
import com.ymatou.iapi.reachpromotion.parameter.GetMultiProductPromotionPolicyResp;
import com.ymatou.iapi.reachpromotion.parameter.GetSellerPromotionInfoByProductIdsBean;
import com.ymatou.iapi.reachpromotion.parameter.HalfPriceProductPromotionDto;
import com.ymatou.iapi.reachpromotion.parameter.Product;
import com.ymatou.iapi.reachpromotion.parameter.ProductDto;
import com.ymatou.iapi.reachpromotion.parameter.ProductPromotionInfoDto;
import com.ymatou.iapi.reachpromotion.parameter.ProductPromotionPolicyDto;
import com.ymatou.iapi.reachpromotion.parameter.SellerProduct;
import com.ymatou.iapi.reachpromotion.parameter.SellerProductDto;
import com.ymatou.iapi.reachpromotion.parameter.ShoppingCartCalculateResp;
import com.ymatou.iapi.reachpromotion.parameter.ShoppingCartSellerPromotionDto;
import com.ymatou.iapi.reachpromotion.service.GetSellerPromotionInfoByProductIdsCall;
import com.ymatou.iapi.reachpromotion.service.PromotionInfoVerify;
import com.ymatou.iapi.trading.operate.parameter.enums.PromotionTypeEnum;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
import com.ymttest.business.service.JSellerPromotionCallService;
import com.ymttest.database.mongo.YmtBuyerProductWapper;
import com.ymttest.utils.EnvSetup;
import com.ymttest.utils.TestDataManager;
import com.ymttest.utils.YMTDateUtil;
import com.ymttest.utils.compare.AssertHelper;
/**
*根据商品Id集合获取商品促销信息
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_GetSellerPromotionInfoByProductIds{
	private static GetSellerPromotionInfoByProductIdsBean getsellerpromotioninfobyproductidsBean;
	private static GetSellerPromotionInfoByProductIdsCall getsellerpromotioninfobyproductidsCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("根据商品Id集合获取商品促销信息");
	}

	@Before
	public void caseUp() {
		getsellerpromotioninfobyproductidsBean=new GetSellerPromotionInfoByProductIdsBean();
		getsellerpromotioninfobyproductidsCall=new GetSellerPromotionInfoByProductIdsCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(getsellerpromotioninfobyproductidsCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetSellerPromotionInfoByProductIds_001() {
		Logger.start(true,"购物车计算商品促销信息-根据商品Id集合获取商品促销信息-指定商品-单个商家-单件商品-满件减-满足条件");
		try {
			int buyerid = TestDataManager.getRandomIntNum(6);			

			int sellerid = Integer.valueOf(EnvSetup.getData("couponSellerId"));			
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBeanForSpeicalProduct(sellerid, PromotionTypeEnum.ReduceIfCountEnough);
			int promotionId = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);
			
			ProductDto productDto = new ProductDto();
			
			String productId=createSellerPromotionBean.getPromotionInfo().getProductIds().get(0);
			productDto.setProductId(productId);
			productDto.setCatalogId(TestDataManager.getRandomNum(6));
			productDto.setProductUnitPrice(new BigDecimal(10));
			productDto.setProductQty(2);			
			
			List<ProductDto> productInfos = new ArrayList<>();
			productInfos.add(productDto);
			
			SellerProductDto sellerProductDto = new SellerProductDto();
			sellerProductDto.setSellerId(sellerid);
			sellerProductDto.setProductInfos(productInfos);					
			
			List<SellerProductDto> sellerProducts = new ArrayList<>();
			sellerProducts.add(sellerProductDto);
			
			getsellerpromotioninfobyproductidsBean.setBuyerId(buyerid);
			getsellerpromotioninfobyproductidsBean.setSellerProductInfos(sellerProducts);
			
			getsellerpromotioninfobyproductidsCall.setData(getsellerpromotioninfobyproductidsBean);
			getsellerpromotioninfobyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getsellerpromotioninfobyproductidsCall.getCode(), "验证返回Code");
			
			ShoppingCartCalculateResp sellerProductsPromotionInfos = getsellerpromotioninfobyproductidsCall.getShoppingCartCalculateResp();
			Logger.verifyEquals(sellerid, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto validProductPromotionInfoDto = sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getValidPromotionInfos().get(0);
			
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(validProductPromotionInfoDto.getPromotionPolicyInfo(),false);
			Logger.verifyEquals(createSellerPromotionBean.getPromotionInfo().getPromotionValues().get(0).getValue(), validProductPromotionInfoDto.getPromotionAmount(), "验证返回PromotionAmount");

			ProductDto productDto2 = validProductPromotionInfoDto.getProductInfos().get(0);
			Logger.verifyEquals(productDto.getProductId(), productDto2.getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto.getCatalogId(), productDto2.getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto.getProductUnitPrice(), productDto2.getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto.getProductQty(), productDto2.getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto.getProductUnitPrice().multiply(new BigDecimal(productDto.getProductQty())), productDto2.getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(createSellerPromotionBean.getPromotionInfo().getPromotionValues().get(0).getValue(), productDto2.getPromotionValue(), "验证返回PromotionValue");

			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getInvalidPromotionInfos().size(),"验证InvalidPromotionInfos空");
			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getNonProductPromotionInfos().size(),"验证InvalidPromotionInfos空");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P2.class})
	@TestCase
	@Ignore
	public void Tc_GetSellerPromotionInfoByProductIds_002() {
		Logger.start(true,"购物车计算商品促销信息-根据商品Id集合获取商品促销信息-新老接口对比");
		try {
			int buyerid = TestDataManager.getRandomIntNum(6);			

			int sellerid = TestDataManager.getRandomIntNum(6);			
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBeanForSpeicalProduct(sellerid, PromotionTypeEnum.ReduceIfCountEnough);
			int promotionId = JSellerPromotionCallService.CreateOldSellerPromotion(createSellerPromotionBean);
			Thread.sleep(1000);
	
			ProductDto productDto = new ProductDto();
			
			String productId=createSellerPromotionBean.getPromotionInfo().getProductIds().get(0);
			productDto.setProductId(productId);
			productDto.setCatalogId(TestDataManager.getRandomNum(6));
			productDto.setProductUnitPrice(new BigDecimal(10));
			productDto.setProductQty(2);			
			
			List<ProductDto> productInfos = new ArrayList<>();
			productInfos.add(productDto);
			
			SellerProductDto sellerProductDto = new SellerProductDto();
			sellerProductDto.setSellerId(sellerid);
			sellerProductDto.setProductInfos(productInfos);					
			
			List<SellerProductDto> sellerProducts = new ArrayList<>();
			sellerProducts.add(sellerProductDto);
			
			getsellerpromotioninfobyproductidsBean.setBuyerId(buyerid);
			getsellerpromotioninfobyproductidsBean.setSellerProductInfos(sellerProducts);
			
			getsellerpromotioninfobyproductidsCall.setData(getsellerpromotioninfobyproductidsBean);
			getsellerpromotioninfobyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getsellerpromotioninfobyproductidsCall.getCode(), "验证返回Code");
			
			ShoppingCartCalculateResp sellerProductsPromotionInfos = getsellerpromotioninfobyproductidsCall.getShoppingCartCalculateResp();
			Logger.verifyEquals(sellerid, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto validProductPromotionInfoDto = sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getValidPromotionInfos().get(0);
			
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(validProductPromotionInfoDto.getPromotionPolicyInfo(),false);
			Logger.verifyEquals(createSellerPromotionBean.getPromotionInfo().getPromotionValues().get(0).getValue(), validProductPromotionInfoDto.getPromotionAmount(), "验证返回PromotionAmount");

			ProductDto productDto2 = validProductPromotionInfoDto.getProductInfos().get(0);
			Logger.verifyEquals(productDto.getProductId(), productDto2.getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto.getCatalogId(), productDto2.getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto.getProductUnitPrice(), productDto2.getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto.getProductQty(), productDto2.getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto.getProductUnitPrice().multiply(new BigDecimal(productDto.getProductQty())), productDto2.getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(createSellerPromotionBean.getPromotionInfo().getPromotionValues().get(0).getValue(), productDto2.getPromotionValue(), "验证返回PromotionValue");

			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getInvalidPromotionInfos().size(),"验证InvalidPromotionInfos空");
			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getNonProductPromotionInfos().size(),"验证InvalidPromotionInfos空");
			
			String url = getsellerpromotioninfobyproductidsCall.getUrl();
			url=url.replace("reachpromotion.iapi.ymatou.com", "sellerpromotion.api.ymatou.com");
		
			getsellerpromotioninfobyproductidsCall.setUrl(url);
			
			getsellerpromotioninfobyproductidsCall.callService();				
			
			ShoppingCartCalculateResp sellerProductsPromotionInfos2 = getsellerpromotioninfobyproductidsCall.getShoppingCartCalculateResp();
			Logger.verifyEquals(sellerid, sellerProductsPromotionInfos2.getSellerProductsPromotionInfos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto validProductPromotionInfoDto2 = sellerProductsPromotionInfos2.getSellerProductsPromotionInfos().get(0).getValidPromotionInfos().get(0);
			
			promotionInfoVerify.verifyPromotionPolicyInDB(validProductPromotionInfoDto2.getPromotionPolicyInfo());
			Logger.verifyEquals(createSellerPromotionBean.getPromotionInfo().getPromotionValues().get(0).getValue(), validProductPromotionInfoDto2.getPromotionAmount(), "验证返回PromotionAmount");

			ProductDto productDto3 = validProductPromotionInfoDto2.getProductInfos().get(0);
			Logger.verifyEquals(productDto.getProductId(), productDto3.getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto.getCatalogId(), productDto3.getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto.getProductUnitPrice(), productDto3.getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto.getProductQty(), productDto3.getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto.getProductUnitPrice().multiply(new BigDecimal(productDto.getProductQty())), productDto3.getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(createSellerPromotionBean.getPromotionInfo().getPromotionValues().get(0).getValue(), productDto3.getPromotionValue(), "验证返回PromotionValue");

			Logger.verifyEquals(null,sellerProductsPromotionInfos2.getSellerProductsPromotionInfos().get(0).getInvalidPromotionInfos(),"验证InvalidPromotionInfos空");
			Logger.verifyEquals(null,sellerProductsPromotionInfos2.getSellerProductsPromotionInfos().get(0).getNonProductPromotionInfos(),"验证InvalidPromotionInfos空");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_GetSellerPromotionInfoByProductIds_003() {
		Logger.start(true,"购物车计算商品促销信息-根据商品Id集合获取商品促销信息-活动已取消");
		try {
			int buyerid = TestDataManager.getRandomIntNum(6);			

			int sellerid = Integer.valueOf(EnvSetup.getData("couponSellerId"));			
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBeanForSpeicalProduct(sellerid, PromotionTypeEnum.ReduceIfCountEnough);
			int promotionId = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			ProductDto productDto = new ProductDto();
			
			String productId=createSellerPromotionBean.getPromotionInfo().getProductIds().get(0);
			productDto.setProductId(productId);
			productDto.setCatalogId(TestDataManager.getRandomNum(6));
			productDto.setProductUnitPrice(new BigDecimal(10));
			productDto.setProductQty(2);			
			
			List<ProductDto> productInfos = new ArrayList<>();
			productInfos.add(productDto);
			
			SellerProductDto sellerProductDto = new SellerProductDto();
			sellerProductDto.setSellerId(sellerid);
			sellerProductDto.setProductInfos(productInfos);					
			
			List<SellerProductDto> sellerProducts = new ArrayList<>();
			sellerProducts.add(sellerProductDto);
			
			getsellerpromotioninfobyproductidsBean.setBuyerId(buyerid);
			getsellerpromotioninfobyproductidsBean.setSellerProductInfos(sellerProducts);
			
			getsellerpromotioninfobyproductidsCall.setData(getsellerpromotioninfobyproductidsBean);
			getsellerpromotioninfobyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getsellerpromotioninfobyproductidsCall.getCode(), "验证返回Code");
			
			ShoppingCartCalculateResp sellerProductsPromotionInfos = getsellerpromotioninfobyproductidsCall.getShoppingCartCalculateResp();
			Logger.verifyEquals(sellerid, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getSellerId(), "验证返回SellerId");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getValidPromotionInfos().size(), "验证返回ValidPromotionInfos");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getInvalidPromotionInfos().size(), "验证返回InvalidPromotionInfos");

			ProductPromotionInfoDto nomProductPromotionInfoDto = sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getNonProductPromotionInfos().get(0);
			
			Logger.verifyEquals(null, nomProductPromotionInfoDto.getPromotionPolicyInfo(), "验证返回PromotionPolicyInfo");
			Logger.verifyEquals(0, nomProductPromotionInfoDto.getPromotionAmount().compareTo(new BigDecimal(0)), "验证返回PromotionAmount");

			ProductDto productDto2 = nomProductPromotionInfoDto.getProductInfos().get(0);
			Logger.verifyEquals(productDto.getProductId(), productDto2.getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto.getCatalogId(), productDto2.getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto.getProductUnitPrice(), productDto2.getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto.getProductQty(), productDto2.getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto.getProductUnitPrice().multiply(new BigDecimal(productDto.getProductQty())), productDto2.getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, productDto2.getPromotionValue().compareTo(new BigDecimal(0)), "验证返回PromotionValue");

			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getInvalidPromotionInfos().size(),"验证InvalidPromotionInfos空");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_GetSellerPromotionInfoByProductIds_004() {
		Logger.start(true,"购物车计算商品促销信息-根据商品Id集合获取商品促销信息--活动未开始");
		try {
			int buyerid = TestDataManager.getRandomIntNum(6);			

			int sellerid = Integer.valueOf(EnvSetup.getData("couponSellerId"));			
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBeanForSpeicalProduct(sellerid, PromotionTypeEnum.ReduceIfCountEnough);
			
			createSellerPromotionBean.getPromotionInfo().setPromotionBeginTime(YMTDateUtil.getBeforeOrNextDay(1, YMTDateUtil.YMDTHMS_STRING));
			createSellerPromotionBean.getPromotionInfo().setPromotionEndTime(YMTDateUtil.getBeforeOrNextDay(2, YMTDateUtil.YMDTHMS_STRING));

			int promotionId = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			ProductDto productDto = new ProductDto();
			
			String productId=createSellerPromotionBean.getPromotionInfo().getProductIds().get(0);
			productDto.setProductId(productId);
			productDto.setCatalogId(TestDataManager.getRandomNum(6));
			productDto.setProductUnitPrice(new BigDecimal(10));
			productDto.setProductQty(2);			
			
			List<ProductDto> productInfos = new ArrayList<>();
			productInfos.add(productDto);
			
			SellerProductDto sellerProductDto = new SellerProductDto();
			sellerProductDto.setSellerId(sellerid);
			sellerProductDto.setProductInfos(productInfos);					
			
			List<SellerProductDto> sellerProducts = new ArrayList<>();
			sellerProducts.add(sellerProductDto);
			
			getsellerpromotioninfobyproductidsBean.setBuyerId(buyerid);
			getsellerpromotioninfobyproductidsBean.setSellerProductInfos(sellerProducts);
			
			getsellerpromotioninfobyproductidsCall.setData(getsellerpromotioninfobyproductidsBean);
			getsellerpromotioninfobyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getsellerpromotioninfobyproductidsCall.getCode(), "验证返回Code");
			
			ShoppingCartCalculateResp sellerProductsPromotionInfos = getsellerpromotioninfobyproductidsCall.getShoppingCartCalculateResp();
			
			Logger.verifyEquals(sellerid, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getSellerId(), "验证返回SellerId");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getValidPromotionInfos().size(), "验证返回ValidPromotionInfos");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getInvalidPromotionInfos().size(), "验证返回InvalidPromotionInfos");

			ProductPromotionInfoDto nomProductPromotionInfoDto = sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getNonProductPromotionInfos().get(0);
			
			Logger.verifyEquals(null, nomProductPromotionInfoDto.getPromotionPolicyInfo(), "验证返回PromotionPolicyInfo");
			Logger.verifyEquals(0, nomProductPromotionInfoDto.getPromotionAmount().compareTo(new BigDecimal(0)), "验证返回PromotionAmount");

			ProductDto productDto2 = nomProductPromotionInfoDto.getProductInfos().get(0);
			Logger.verifyEquals(productDto.getProductId(), productDto2.getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto.getCatalogId(), productDto2.getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto.getProductUnitPrice(), productDto2.getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto.getProductQty(), productDto2.getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto.getProductUnitPrice().multiply(new BigDecimal(productDto.getProductQty())), productDto2.getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, productDto2.getPromotionValue().compareTo(new BigDecimal(0)), "验证返回PromotionValue");

			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getInvalidPromotionInfos().size(),"验证InvalidPromotionInfos空");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_GetSellerPromotionInfoByProductIds_005() {
		Logger.start(true,"购物车计算商品促销信息-根据商品Id集合获取商品促销信息-指定商品-单个商家-单件商品-满件减-满不足条件");
		try {
			int buyerid = TestDataManager.getRandomIntNum(6);			

			int sellerid = Integer.valueOf(EnvSetup.getData("couponSellerId"));			
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBeanForSpeicalProduct(sellerid, PromotionTypeEnum.DiscountIfCountEnough);
			
			int promotionId = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);
			
			ProductDto productDto = new ProductDto();
			
			String productId=createSellerPromotionBean.getPromotionInfo().getProductIds().get(0);
			productDto.setProductId(productId);
			productDto.setCatalogId(TestDataManager.getRandomNum(6));
			productDto.setProductUnitPrice(new BigDecimal(10));
			productDto.setProductQty(1);			
			
			List<ProductDto> productInfos = new ArrayList<>();
			productInfos.add(productDto);
			
			SellerProductDto sellerProductDto = new SellerProductDto();
			sellerProductDto.setSellerId(sellerid);
			sellerProductDto.setProductInfos(productInfos);					
			
			List<SellerProductDto> sellerProducts = new ArrayList<>();
			sellerProducts.add(sellerProductDto);
			
			getsellerpromotioninfobyproductidsBean.setBuyerId(buyerid);
			getsellerpromotioninfobyproductidsBean.setSellerProductInfos(sellerProducts);
			
			getsellerpromotioninfobyproductidsCall.setData(getsellerpromotioninfobyproductidsBean);
			getsellerpromotioninfobyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getsellerpromotioninfobyproductidsCall.getCode(), "验证返回Code");
			
			ShoppingCartCalculateResp sellerProductsPromotionInfos = getsellerpromotioninfobyproductidsCall.getShoppingCartCalculateResp();
			Logger.verifyEquals(sellerid, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getSellerId(), "验证返回SellerId");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getValidPromotionInfos().size(), "验证返回ValidPromotionInfos");

			ProductPromotionInfoDto invalidProductPromotionInfoDto = sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getInvalidPromotionInfos().get(0);
			
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(invalidProductPromotionInfoDto.getPromotionPolicyInfo(),false);
			
			Logger.verifyEquals(0, invalidProductPromotionInfoDto.getPromotionAmount().compareTo(new BigDecimal(0)), "验证返回PromotionAmount");

			ProductDto productDto2 = invalidProductPromotionInfoDto.getProductInfos().get(0);
			Logger.verifyEquals(productDto.getProductId(), productDto2.getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto.getCatalogId(), productDto2.getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto.getProductUnitPrice(), productDto2.getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto.getProductQty(), productDto2.getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto.getProductUnitPrice().multiply(new BigDecimal(productDto.getProductQty())), productDto2.getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, productDto2.getPromotionValue().compareTo(new BigDecimal(0)), "验证返回PromotionValue");

			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getNonProductPromotionInfos().size(),"验证InvalidPromotionInfos空");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_GetSellerPromotionInfoByProductIds_006() {
		Logger.start(true,"购物车计算商品促销信息-根据商品Id集合获取商品促销信息-指定商品-单个商家-单件商品-满件折-满足条件");
		try {
			int buyerid = TestDataManager.getRandomIntNum(6);			

			int sellerid = Integer.valueOf(EnvSetup.getData("couponSellerId"));			
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBeanForSpeicalProduct(sellerid, PromotionTypeEnum.DiscountIfCountEnough);
			createSellerPromotionBean.getPromotionInfo().getPromotionValues().get(0).setValue(new BigDecimal(5));

			int promotionId = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);
			
			ProductDto productDto = new ProductDto();
			
			String productId=createSellerPromotionBean.getPromotionInfo().getProductIds().get(0);
			productDto.setProductId(productId);
			productDto.setCatalogId(TestDataManager.getRandomNum(6));
			productDto.setProductUnitPrice(new BigDecimal(10));
			productDto.setProductQty(3);			
			
			List<ProductDto> productInfos = new ArrayList<>();
			productInfos.add(productDto);
			
			SellerProductDto sellerProductDto = new SellerProductDto();
			sellerProductDto.setSellerId(sellerid);
			sellerProductDto.setProductInfos(productInfos);					
			
			List<SellerProductDto> sellerProducts = new ArrayList<>();
			sellerProducts.add(sellerProductDto);
			
			getsellerpromotioninfobyproductidsBean.setBuyerId(buyerid);
			getsellerpromotioninfobyproductidsBean.setSellerProductInfos(sellerProducts);
			
			getsellerpromotioninfobyproductidsCall.setData(getsellerpromotioninfobyproductidsBean);
			getsellerpromotioninfobyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getsellerpromotioninfobyproductidsCall.getCode(), "验证返回Code");
			
			ShoppingCartCalculateResp sellerProductsPromotionInfos = getsellerpromotioninfobyproductidsCall.getShoppingCartCalculateResp();
			Logger.verifyEquals(sellerid, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto validProductPromotionInfoDto = sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getValidPromotionInfos().get(0);
			
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(validProductPromotionInfoDto.getPromotionPolicyInfo(),false);
			Logger.verifyEquals(0, validProductPromotionInfoDto.getPromotionAmount().compareTo(new BigDecimal(15)), "验证返回PromotionAmount");

			ProductDto productDto2 = validProductPromotionInfoDto.getProductInfos().get(0);
			Logger.verifyEquals(productDto.getProductId(), productDto2.getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto.getCatalogId(), productDto2.getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto.getProductUnitPrice(), productDto2.getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto.getProductQty(), productDto2.getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto.getProductUnitPrice().multiply(new BigDecimal(productDto.getProductQty())), productDto2.getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, productDto2.getPromotionValue().compareTo(new BigDecimal(15)), "验证返回PromotionValue");

			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getInvalidPromotionInfos().size(),"验证InvalidPromotionInfos空");
			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getNonProductPromotionInfos().size(),"验证InvalidPromotionInfos空");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_GetSellerPromotionInfoByProductIds_007() {
		Logger.start(true,"购物车计算商品促销信息-根据商品Id集合获取商品促销信息-指定商品-单个商家-单件商品-满件折-不满足条件");
		try {
			int buyerid = TestDataManager.getRandomIntNum(6);			

			int sellerid = Integer.valueOf(EnvSetup.getData("couponSellerId"));			
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBeanForSpeicalProduct(sellerid, PromotionTypeEnum.ReduceIfCountEnough);
			int promotionId = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);
			
			ProductDto productDto = new ProductDto();
			
			String productId=createSellerPromotionBean.getPromotionInfo().getProductIds().get(0);
			productDto.setProductId(productId);
			productDto.setCatalogId(TestDataManager.getRandomNum(6));
			productDto.setProductUnitPrice(new BigDecimal(10));
			productDto.setProductQty(1);			
			
			List<ProductDto> productInfos = new ArrayList<>();
			productInfos.add(productDto);
			
			SellerProductDto sellerProductDto = new SellerProductDto();
			sellerProductDto.setSellerId(sellerid);
			sellerProductDto.setProductInfos(productInfos);					
			
			List<SellerProductDto> sellerProducts = new ArrayList<>();
			sellerProducts.add(sellerProductDto);
			
			getsellerpromotioninfobyproductidsBean.setBuyerId(buyerid);
			getsellerpromotioninfobyproductidsBean.setSellerProductInfos(sellerProducts);
			
			getsellerpromotioninfobyproductidsCall.setData(getsellerpromotioninfobyproductidsBean);
			getsellerpromotioninfobyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getsellerpromotioninfobyproductidsCall.getCode(), "验证返回Code");
			
			ShoppingCartCalculateResp sellerProductsPromotionInfos = getsellerpromotioninfobyproductidsCall.getShoppingCartCalculateResp();
			Logger.verifyEquals(sellerid, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getSellerId(), "验证返回SellerId");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getValidPromotionInfos().size(), "验证返回ValidPromotionInfos");

			ProductPromotionInfoDto invalidProductPromotionInfoDto = sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getInvalidPromotionInfos().get(0);
			
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(invalidProductPromotionInfoDto.getPromotionPolicyInfo(),false);
			
			Logger.verifyEquals(0, invalidProductPromotionInfoDto.getPromotionAmount().compareTo(new BigDecimal(0)), "验证返回PromotionAmount");

			ProductDto productDto2 = invalidProductPromotionInfoDto.getProductInfos().get(0);
			Logger.verifyEquals(productDto.getProductId(), productDto2.getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto.getCatalogId(), productDto2.getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto.getProductUnitPrice(), productDto2.getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto.getProductQty(), productDto2.getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto.getProductUnitPrice().multiply(new BigDecimal(productDto.getProductQty())), productDto2.getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, productDto2.getPromotionValue().compareTo(new BigDecimal(0)), "验证返回PromotionValue");

			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getNonProductPromotionInfos().size(),"验证InvalidPromotionInfos空");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_GetSellerPromotionInfoByProductIds_008() {
		Logger.start(true,"购物车计算商品促销信息-根据商品Id集合获取商品促销信息-指定商品-单个商家-单件商品-满金额减-满足条件");
		try {
			int buyerid = TestDataManager.getRandomIntNum(6);			

			int sellerid = Integer.valueOf(EnvSetup.getData("couponSellerId"));			
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBeanForSpeicalProduct(sellerid, PromotionTypeEnum.ReduceIfAmountEnough);
			createSellerPromotionBean.getPromotionInfo().getPromotionValues().get(0).setValue(new BigDecimal(5));

			int promotionId = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);
			
			ProductDto productDto = new ProductDto();
			
			String productId=createSellerPromotionBean.getPromotionInfo().getProductIds().get(0);
			productDto.setProductId(productId);
			productDto.setCatalogId(TestDataManager.getRandomNum(6));
			productDto.setProductUnitPrice(new BigDecimal(10));
			productDto.setProductQty(4);			
			
			List<ProductDto> productInfos = new ArrayList<>();
			productInfos.add(productDto);
			
			SellerProductDto sellerProductDto = new SellerProductDto();
			sellerProductDto.setSellerId(sellerid);
			sellerProductDto.setProductInfos(productInfos);					
			
			List<SellerProductDto> sellerProducts = new ArrayList<>();
			sellerProducts.add(sellerProductDto);
			
			getsellerpromotioninfobyproductidsBean.setBuyerId(buyerid);
			getsellerpromotioninfobyproductidsBean.setSellerProductInfos(sellerProducts);
			
			getsellerpromotioninfobyproductidsCall.setData(getsellerpromotioninfobyproductidsBean);
			getsellerpromotioninfobyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getsellerpromotioninfobyproductidsCall.getCode(), "验证返回Code");
			
			ShoppingCartCalculateResp sellerProductsPromotionInfos = getsellerpromotioninfobyproductidsCall.getShoppingCartCalculateResp();
			Logger.verifyEquals(sellerid, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto validProductPromotionInfoDto = sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getValidPromotionInfos().get(0);
			
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(validProductPromotionInfoDto.getPromotionPolicyInfo(),false);
			Logger.verifyEquals(0, validProductPromotionInfoDto.getPromotionAmount().compareTo(new BigDecimal(5)), "验证返回PromotionAmount");

			ProductDto productDto2 = validProductPromotionInfoDto.getProductInfos().get(0);
			Logger.verifyEquals(productDto.getProductId(), productDto2.getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto.getCatalogId(), productDto2.getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto.getProductUnitPrice(), productDto2.getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto.getProductQty(), productDto2.getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto.getProductUnitPrice().multiply(new BigDecimal(productDto.getProductQty())), productDto2.getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, productDto2.getPromotionValue().compareTo(new BigDecimal(5)), "验证返回PromotionValue");

			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getInvalidPromotionInfos().size(),"验证InvalidPromotionInfos空");
			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getNonProductPromotionInfos().size(),"验证InvalidPromotionInfos空");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_GetSellerPromotionInfoByProductIds_009() {
		Logger.start(true,"购物车计算商品促销信息-根据商品Id集合获取商品促销信息-指定商品-单个商家-单件商品-满金额减-不满足条件");
		try {
			int buyerid = TestDataManager.getRandomIntNum(6);			

			int sellerid = Integer.valueOf(EnvSetup.getData("couponSellerId"));			
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBeanForSpeicalProduct(sellerid, PromotionTypeEnum.ReduceIfCountEnough);
			int promotionId = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);
			
			ProductDto productDto = new ProductDto();
			
			String productId=createSellerPromotionBean.getPromotionInfo().getProductIds().get(0);
			productDto.setProductId(productId);
			productDto.setCatalogId(TestDataManager.getRandomNum(6));
			productDto.setProductUnitPrice(new BigDecimal(5));
			productDto.setProductQty(1);			
			
			List<ProductDto> productInfos = new ArrayList<>();
			productInfos.add(productDto);
			
			SellerProductDto sellerProductDto = new SellerProductDto();
			sellerProductDto.setSellerId(sellerid);
			sellerProductDto.setProductInfos(productInfos);					
			
			List<SellerProductDto> sellerProducts = new ArrayList<>();
			sellerProducts.add(sellerProductDto);
			
			getsellerpromotioninfobyproductidsBean.setBuyerId(buyerid);
			getsellerpromotioninfobyproductidsBean.setSellerProductInfos(sellerProducts);
			
			getsellerpromotioninfobyproductidsCall.setData(getsellerpromotioninfobyproductidsBean);
			getsellerpromotioninfobyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getsellerpromotioninfobyproductidsCall.getCode(), "验证返回Code");
			
			ShoppingCartCalculateResp sellerProductsPromotionInfos = getsellerpromotioninfobyproductidsCall.getShoppingCartCalculateResp();
			Logger.verifyEquals(sellerid, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getSellerId(), "验证返回SellerId");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getValidPromotionInfos().size(), "验证返回ValidPromotionInfos");

			ProductPromotionInfoDto invalidProductPromotionInfoDto = sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getInvalidPromotionInfos().get(0);
			
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(invalidProductPromotionInfoDto.getPromotionPolicyInfo(),false);
			
			Logger.verifyEquals(0, invalidProductPromotionInfoDto.getPromotionAmount().compareTo(new BigDecimal(0)), "验证返回PromotionAmount");

			ProductDto productDto2 = invalidProductPromotionInfoDto.getProductInfos().get(0);
			Logger.verifyEquals(productDto.getProductId(), productDto2.getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto.getCatalogId(), productDto2.getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto.getProductUnitPrice(), productDto2.getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto.getProductQty(), productDto2.getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto.getProductUnitPrice().multiply(new BigDecimal(productDto.getProductQty())), productDto2.getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, productDto2.getPromotionValue().compareTo(new BigDecimal(0)), "验证返回PromotionValue");

			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getNonProductPromotionInfos().size(),"验证InvalidPromotionInfos空");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	

	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_GetSellerPromotionInfoByProductIds_010() {
		Logger.start(true,"购物车计算商品促销信息-根据商品Id集合获取商品促销信息-指定商品-单个商家-单件商品-满金额折-满足条件");
		try {
			int buyerid = TestDataManager.getRandomIntNum(6);			

			int sellerid = Integer.valueOf(EnvSetup.getData("couponSellerId"));			
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBeanForSpeicalProduct(sellerid, PromotionTypeEnum.DiscountIfAmountEnough);
			createSellerPromotionBean.getPromotionInfo().getPromotionValues().get(0).setValue(new BigDecimal(6));

			int promotionId = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);
			
			ProductDto productDto = new ProductDto();
			
			String productId=createSellerPromotionBean.getPromotionInfo().getProductIds().get(0);
			productDto.setProductId(productId);
			productDto.setCatalogId(TestDataManager.getRandomNum(6));
			productDto.setProductUnitPrice(new BigDecimal(10));
			productDto.setProductQty(4);			
			
			List<ProductDto> productInfos = new ArrayList<>();
			productInfos.add(productDto);
			
			SellerProductDto sellerProductDto = new SellerProductDto();
			sellerProductDto.setSellerId(sellerid);
			sellerProductDto.setProductInfos(productInfos);					
			
			List<SellerProductDto> sellerProducts = new ArrayList<>();
			sellerProducts.add(sellerProductDto);
			
			getsellerpromotioninfobyproductidsBean.setBuyerId(buyerid);
			getsellerpromotioninfobyproductidsBean.setSellerProductInfos(sellerProducts);
			
			getsellerpromotioninfobyproductidsCall.setData(getsellerpromotioninfobyproductidsBean);
			getsellerpromotioninfobyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getsellerpromotioninfobyproductidsCall.getCode(), "验证返回Code");
			
			ShoppingCartCalculateResp sellerProductsPromotionInfos = getsellerpromotioninfobyproductidsCall.getShoppingCartCalculateResp();
			Logger.verifyEquals(sellerid, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto validProductPromotionInfoDto = sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getValidPromotionInfos().get(0);
			
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(validProductPromotionInfoDto.getPromotionPolicyInfo(),false);
			Logger.verifyEquals(0, validProductPromotionInfoDto.getPromotionAmount().compareTo(new BigDecimal(16)), "验证返回PromotionAmount");

			ProductDto productDto2 = validProductPromotionInfoDto.getProductInfos().get(0);
			Logger.verifyEquals(productDto.getProductId(), productDto2.getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto.getCatalogId(), productDto2.getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto.getProductUnitPrice(), productDto2.getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto.getProductQty(), productDto2.getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto.getProductUnitPrice().multiply(new BigDecimal(productDto.getProductQty())), productDto2.getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, productDto2.getPromotionValue().compareTo(new BigDecimal(16)), "验证返回PromotionValue");

			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getInvalidPromotionInfos().size(),"验证InvalidPromotionInfos空");
			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getNonProductPromotionInfos().size(),"验证InvalidPromotionInfos空");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_GetSellerPromotionInfoByProductIds_011() {
		Logger.start(true,"购物车计算商品促销信息-根据商品Id集合获取商品促销信息-指定商品-单个商家-单件商品-满金额折-不满足条件");
		try {
			int buyerid = TestDataManager.getRandomIntNum(6);			

			int sellerid = Integer.valueOf(EnvSetup.getData("couponSellerId"));			
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBeanForSpeicalProduct(sellerid, PromotionTypeEnum.DiscountIfAmountEnough);
			int promotionId = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);
			
			ProductDto productDto = new ProductDto();
			
			String productId=createSellerPromotionBean.getPromotionInfo().getProductIds().get(0);
			productDto.setProductId(productId);
			productDto.setCatalogId(TestDataManager.getRandomNum(6));
			productDto.setProductUnitPrice(new BigDecimal(5));
			productDto.setProductQty(1);			
			
			List<ProductDto> productInfos = new ArrayList<>();
			productInfos.add(productDto);
			
			SellerProductDto sellerProductDto = new SellerProductDto();
			sellerProductDto.setSellerId(sellerid);
			sellerProductDto.setProductInfos(productInfos);					
			
			List<SellerProductDto> sellerProducts = new ArrayList<>();
			sellerProducts.add(sellerProductDto);
			
			getsellerpromotioninfobyproductidsBean.setBuyerId(buyerid);
			getsellerpromotioninfobyproductidsBean.setSellerProductInfos(sellerProducts);
			
			getsellerpromotioninfobyproductidsCall.setData(getsellerpromotioninfobyproductidsBean);
			getsellerpromotioninfobyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getsellerpromotioninfobyproductidsCall.getCode(), "验证返回Code");
			
			ShoppingCartCalculateResp sellerProductsPromotionInfos = getsellerpromotioninfobyproductidsCall.getShoppingCartCalculateResp();
			Logger.verifyEquals(sellerid, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getSellerId(), "验证返回SellerId");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getValidPromotionInfos().size(), "验证返回ValidPromotionInfos");

			ProductPromotionInfoDto invalidProductPromotionInfoDto = sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getInvalidPromotionInfos().get(0);
			
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(invalidProductPromotionInfoDto.getPromotionPolicyInfo(),false);
			
			Logger.verifyEquals(0, invalidProductPromotionInfoDto.getPromotionAmount().compareTo(new BigDecimal(0)), "验证返回PromotionAmount");

			ProductDto productDto2 = invalidProductPromotionInfoDto.getProductInfos().get(0);
			Logger.verifyEquals(productDto.getProductId(), productDto2.getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto.getCatalogId(), productDto2.getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto.getProductUnitPrice(), productDto2.getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto.getProductQty(), productDto2.getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto.getProductUnitPrice().multiply(new BigDecimal(productDto.getProductQty())), productDto2.getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, productDto2.getPromotionValue().compareTo(new BigDecimal(0)), "验证返回PromotionValue");

			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getNonProductPromotionInfos().size(),"验证InvalidPromotionInfos空");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_GetSellerPromotionInfoByProductIds_012() {
		Logger.start(true,"购物车计算商品促销信息-根据商品Id集合获取商品促销信息-指定商品-单个商家-单件商品-第二件半价-满足条件");
		try {
			int buyerid = TestDataManager.getRandomIntNum(6);			

			int sellerid = Integer.valueOf(EnvSetup.getData("couponSellerId"));			
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBeanForSpeicalProduct(sellerid, PromotionTypeEnum.HalfIfCountEnough);
			createSellerPromotionBean.getPromotionInfo().getPromotionValues().get(0).setValue(new BigDecimal(6));

			int promotionId = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);
			
			ProductDto productDto = new ProductDto();
			
			String productId=createSellerPromotionBean.getPromotionInfo().getProductIds().get(0);
			productDto.setProductId(productId);
			productDto.setCatalogId(TestDataManager.getRandomNum(6));
			productDto.setProductUnitPrice(new BigDecimal(10));
			productDto.setProductQty(8);			
			
			List<ProductDto> productInfos = new ArrayList<>();
			productInfos.add(productDto);
			
			SellerProductDto sellerProductDto = new SellerProductDto();
			sellerProductDto.setSellerId(sellerid);
			sellerProductDto.setProductInfos(productInfos);					
			
			List<SellerProductDto> sellerProducts = new ArrayList<>();
			sellerProducts.add(sellerProductDto);
			
			getsellerpromotioninfobyproductidsBean.setBuyerId(buyerid);
			getsellerpromotioninfobyproductidsBean.setSellerProductInfos(sellerProducts);
			
			getsellerpromotioninfobyproductidsCall.setData(getsellerpromotioninfobyproductidsBean);
			getsellerpromotioninfobyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getsellerpromotioninfobyproductidsCall.getCode(), "验证返回Code");
			
			ShoppingCartCalculateResp sellerProductsPromotionInfos = getsellerpromotioninfobyproductidsCall.getShoppingCartCalculateResp();
			Logger.verifyEquals(sellerid, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto validProductPromotionInfoDto = sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getValidPromotionInfos().get(0);
			
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(validProductPromotionInfoDto.getPromotionPolicyInfo(),false);
			Logger.verifyEquals(0, validProductPromotionInfoDto.getPromotionAmount().compareTo(new BigDecimal(20)), "验证返回PromotionAmount");

			ProductDto productDto2 = validProductPromotionInfoDto.getProductInfos().get(0);
			Logger.verifyEquals(productDto.getProductId(), productDto2.getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto.getCatalogId(), productDto2.getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto.getProductUnitPrice(), productDto2.getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto.getProductQty(), productDto2.getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto.getProductUnitPrice().multiply(new BigDecimal(productDto.getProductQty())), productDto2.getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, productDto2.getPromotionValue().compareTo(new BigDecimal(20)), "验证返回PromotionValue");

			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getInvalidPromotionInfos().size(),"验证InvalidPromotionInfos空");
			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getNonProductPromotionInfos().size(),"验证InvalidPromotionInfos空");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_GetSellerPromotionInfoByProductIds_013() {
		Logger.start(true,"购物车计算商品促销信息-根据商品Id集合获取商品促销信息-指定商品-单个商家-单件商品-第二件半价-不满足条件");
		try {
			int buyerid = TestDataManager.getRandomIntNum(6);			

			int sellerid = Integer.valueOf(EnvSetup.getData("couponSellerId"));			
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBeanForSpeicalProduct(sellerid, PromotionTypeEnum.HalfIfCountEnough);
			int promotionId = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);
			
			ProductDto productDto = new ProductDto();
			
			String productId=createSellerPromotionBean.getPromotionInfo().getProductIds().get(0);
			productDto.setProductId(productId);
			productDto.setCatalogId(TestDataManager.getRandomNum(6));
			productDto.setProductUnitPrice(new BigDecimal(5));
			productDto.setProductQty(1);			
			
			List<ProductDto> productInfos = new ArrayList<>();
			productInfos.add(productDto);
			
			SellerProductDto sellerProductDto = new SellerProductDto();
			sellerProductDto.setSellerId(sellerid);
			sellerProductDto.setProductInfos(productInfos);					
			
			List<SellerProductDto> sellerProducts = new ArrayList<>();
			sellerProducts.add(sellerProductDto);
			
			getsellerpromotioninfobyproductidsBean.setBuyerId(buyerid);
			getsellerpromotioninfobyproductidsBean.setSellerProductInfos(sellerProducts);
			
			getsellerpromotioninfobyproductidsCall.setData(getsellerpromotioninfobyproductidsBean);
			getsellerpromotioninfobyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getsellerpromotioninfobyproductidsCall.getCode(), "验证返回Code");
			
			ShoppingCartCalculateResp sellerProductsPromotionInfos = getsellerpromotioninfobyproductidsCall.getShoppingCartCalculateResp();
			Logger.verifyEquals(sellerid, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getSellerId(), "验证返回SellerId");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getValidPromotionInfos().size(), "验证返回ValidPromotionInfos");

			ProductPromotionInfoDto invalidProductPromotionInfoDto = sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getInvalidPromotionInfos().get(0);
			
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(invalidProductPromotionInfoDto.getPromotionPolicyInfo(),false);
			
			Logger.verifyEquals(0, invalidProductPromotionInfoDto.getPromotionAmount().compareTo(new BigDecimal(0)), "验证返回PromotionAmount");

			ProductDto productDto2 = invalidProductPromotionInfoDto.getProductInfos().get(0);
			Logger.verifyEquals(productDto.getProductId(), productDto2.getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto.getCatalogId(), productDto2.getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto.getProductUnitPrice(), productDto2.getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto.getProductQty(), productDto2.getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto.getProductUnitPrice().multiply(new BigDecimal(productDto.getProductQty())), productDto2.getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, productDto2.getPromotionValue().compareTo(new BigDecimal(0)), "验证返回PromotionValue");

			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getNonProductPromotionInfos().size(),"验证InvalidPromotionInfos空");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_GetSellerPromotionInfoByProductIds_014() {
		Logger.start(true,"购物车计算商品促销信息-根据商品Id集合获取商品促销信息-全场商品-单个商家-多件商品-满件减-满足条件");
		try {
			int buyerid = TestDataManager.getRandomIntNum(6);			

			int sellerid = Integer.valueOf(EnvSetup.getData("couponSellerId"));			
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBean(sellerid, PromotionTypeEnum.ReduceIfCountEnough);
			int promotionId = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);
			
			List<String> productIds = new ArrayList<>();
			
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(4);
		
			ProductDto productDto1 = new ProductDto();
			
			productDto1.setProductId(bpw.get(0).get("ProductId").toString());
			productDto1.setCatalogId(TestDataManager.getRandomNum(6));
			productDto1.setProductUnitPrice(new BigDecimal(5));
			productDto1.setProductQty(2);	
			
			ProductDto productDto2 = new ProductDto();
			
			productDto2.setProductId(bpw.get(1).get("ProductId").toString());
			productDto2.setCatalogId(TestDataManager.getRandomNum(6));
			productDto2.setProductUnitPrice(new BigDecimal(10));
			productDto2.setProductQty(1);
			
			ProductDto productDto3 = new ProductDto();
			
			productDto3.setProductId(bpw.get(2).get("ProductId").toString());
			productDto3.setCatalogId(TestDataManager.getRandomNum(6));
			productDto3.setProductUnitPrice(new BigDecimal(10));
			productDto3.setProductQty(2);
			
			List<ProductDto> productInfos = new ArrayList<>();
			productInfos.add(productDto1);
			productInfos.add(productDto2);
			productInfos.add(productDto3);

			SellerProductDto sellerProductDto = new SellerProductDto();
			sellerProductDto.setSellerId(sellerid);
			sellerProductDto.setProductInfos(productInfos);					
			
			List<SellerProductDto> sellerProducts = new ArrayList<>();
			sellerProducts.add(sellerProductDto);
			
			getsellerpromotioninfobyproductidsBean.setBuyerId(buyerid);
			getsellerpromotioninfobyproductidsBean.setSellerProductInfos(sellerProducts);
			
			getsellerpromotioninfobyproductidsCall.setData(getsellerpromotioninfobyproductidsBean);
			getsellerpromotioninfobyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getsellerpromotioninfobyproductidsCall.getCode(), "验证返回Code");
			
			ShoppingCartCalculateResp sellerProductsPromotionInfos = getsellerpromotioninfobyproductidsCall.getShoppingCartCalculateResp();
			Logger.verifyEquals(sellerid, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto validProductPromotionInfoDto = sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getValidPromotionInfos().get(0);
			
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(validProductPromotionInfoDto.getPromotionPolicyInfo(),false);
			Logger.verifyEquals(createSellerPromotionBean.getPromotionInfo().getPromotionValues().get(0).getValue(), validProductPromotionInfoDto.getPromotionAmount(), "验证返回PromotionAmount");

			List<ProductDto> returnProductDtos = validProductPromotionInfoDto.getProductInfos();
			
			for(int i=0;i<returnProductDtos.size();i++)
			{
				ProductDto productDto=getsellerpromotioninfobyproductidsBean.getSellerProductInfos().get(0).getProductInfos().get(i);
				Logger.verifyEquals(productDto.getProductId(), returnProductDtos.get(i).getProductId(), "验证返回ProductId");
				Logger.verifyEquals(productDto.getCatalogId(), returnProductDtos.get(i).getCatalogId(), "验证返回CatalogId");
				Logger.verifyEquals(productDto.getProductUnitPrice(), returnProductDtos.get(i).getProductUnitPrice(), "验证返回ProductUnitPrice");
				Logger.verifyEquals(productDto.getProductQty(), returnProductDtos.get(i).getProductQty(), "验证返回ProductQty");
				Logger.verifyEquals(productDto.getProductUnitPrice().multiply(new BigDecimal(productDto.getProductQty())), returnProductDtos.get(i).getProductTotalPrice(), "验证返回ProductTotalPrice");
				
				Logger.comment(returnProductDtos.get(i).getPromotionValue().toString()+":"+returnProductDtos.get(i).getProductTotalPrice().multiply(BigDecimal.valueOf(0.025)));
				Logger.verifyEquals(0, returnProductDtos.get(i).getPromotionValue().compareTo(returnProductDtos.get(i).getProductTotalPrice().multiply(BigDecimal.valueOf(0.025))), "验证返回PromotionValue");
			}
			
			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getInvalidPromotionInfos().size(),"验证InvalidPromotionInfos空");
			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getNonProductPromotionInfos().size(),"验证InvalidPromotionInfos空");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_GetSellerPromotionInfoByProductIds_015() {
		Logger.start(true,"购物车计算商品促销信息-根据商品Id集合获取商品促销信息-全场商品-单个商家-多件商品-满件减-不满足条件");
		try {
			int buyerid = TestDataManager.getRandomIntNum(6);			

			int sellerid = Integer.valueOf(EnvSetup.getData("couponSellerId"));			
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBean(sellerid, PromotionTypeEnum.ReduceIfCountEnough);
			int promotionId = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);
			
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(4);
			
			ProductDto productDto1 = new ProductDto();
			
			productDto1.setProductId(bpw.get(0).get("ProductId").toString());
			productDto1.setCatalogId(TestDataManager.getRandomNum(6));
			productDto1.setProductUnitPrice(new BigDecimal(10));
			productDto1.setProductQty(1);	
			
			ProductDto productDto2 = new ProductDto();
			
			productDto2.setProductId(bpw.get(1).get("ProductId").toString());
			productDto2.setCatalogId(TestDataManager.getRandomNum(6));
			productDto2.setProductUnitPrice(new BigDecimal(1));
			productDto2.setProductQty(1);
			
			ProductDto productDto3 = new ProductDto();
			
			productDto3.setProductId(bpw.get(2).get("ProductId").toString());
			productDto3.setCatalogId(TestDataManager.getRandomNum(6));
			productDto3.setProductUnitPrice(new BigDecimal(1));
			productDto3.setProductQty(2);
			
			List<ProductDto> productInfos = new ArrayList<>();
			productInfos.add(productDto1);
			productInfos.add(productDto2);
			productInfos.add(productDto3);
			
			SellerProductDto sellerProductDto = new SellerProductDto();
			sellerProductDto.setSellerId(sellerid);
			sellerProductDto.setProductInfos(productInfos);					
			
			List<SellerProductDto> sellerProducts = new ArrayList<>();
			sellerProducts.add(sellerProductDto);
			
			getsellerpromotioninfobyproductidsBean.setBuyerId(buyerid);
			getsellerpromotioninfobyproductidsBean.setSellerProductInfos(sellerProducts);
			
			getsellerpromotioninfobyproductidsCall.setData(getsellerpromotioninfobyproductidsBean);
			getsellerpromotioninfobyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getsellerpromotioninfobyproductidsCall.getCode(), "验证返回Code");
			
			ShoppingCartCalculateResp sellerProductsPromotionInfos = getsellerpromotioninfobyproductidsCall.getShoppingCartCalculateResp();
			Logger.verifyEquals(sellerid, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getSellerId(), "验证返回SellerId");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getValidPromotionInfos().size(), "验证返回ValidPromotionInfos");

			ProductPromotionInfoDto invalidProductPromotionInfoDto = sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getInvalidPromotionInfos().get(0);
			
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(invalidProductPromotionInfoDto.getPromotionPolicyInfo(),false);
			
			Logger.verifyEquals(0, invalidProductPromotionInfoDto.getPromotionAmount().compareTo(new BigDecimal(0)), "验证返回PromotionAmount");

			List<ProductDto> returnProductDtos = invalidProductPromotionInfoDto.getProductInfos();
			
			for(int i=0;i<returnProductDtos.size();i++)
			{
				ProductDto productDto=getsellerpromotioninfobyproductidsBean.getSellerProductInfos().get(0).getProductInfos().get(i);
				Logger.verifyEquals(productDto.getProductId(), returnProductDtos.get(i).getProductId(), "验证返回ProductId");
				Logger.verifyEquals(productDto.getCatalogId(), returnProductDtos.get(i).getCatalogId(), "验证返回CatalogId");
				Logger.verifyEquals(productDto.getProductUnitPrice(), returnProductDtos.get(i).getProductUnitPrice(), "验证返回ProductUnitPrice");
				Logger.verifyEquals(productDto.getProductQty(), returnProductDtos.get(i).getProductQty(), "验证返回ProductQty");
				Logger.verifyEquals(0, returnProductDtos.get(i).getProductTotalPrice().compareTo(returnProductDtos.get(i).getProductUnitPrice().multiply(BigDecimal.valueOf(returnProductDtos.get(i).getProductQty()))), "验证返回ProductTotalPrice");
				
				Logger.comment(returnProductDtos.get(i).getPromotionValue().toString()+":"+returnProductDtos.get(i).getProductTotalPrice().multiply(BigDecimal.valueOf(0.025)));
				Logger.verifyEquals(0, returnProductDtos.get(i).getPromotionValue().compareTo(BigDecimal.valueOf(0)), "验证返回PromotionValue");
			}
			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getNonProductPromotionInfos().size(),"验证InvalidPromotionInfos空");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_GetSellerPromotionInfoByProductIds_016() {
		Logger.start(true,"购物车计算商品促销信息-根据商品Id集合获取商品促销信息-全场商品-单个商家-多件商品-满件折-满足条件");
		try {
			int buyerid = TestDataManager.getRandomIntNum(6);			

			int sellerid = Integer.valueOf(EnvSetup.getData("couponSellerId"));			
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBean(sellerid, PromotionTypeEnum.DiscountIfCountEnough);
			createSellerPromotionBean.getPromotionInfo().getPromotionValues().get(0).setValue(new BigDecimal(2));
			int promotionId = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);
			
			List<String> productIds = new ArrayList<>();
			
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(4);
		
			ProductDto productDto1 = new ProductDto();
			
			productDto1.setProductId(bpw.get(0).get("ProductId").toString());
			productDto1.setCatalogId(TestDataManager.getRandomNum(6));
			productDto1.setProductUnitPrice(new BigDecimal(5));
			productDto1.setProductQty(2);	
			
			ProductDto productDto2 = new ProductDto();
			
			productDto2.setProductId(bpw.get(1).get("ProductId").toString());
			productDto2.setCatalogId(TestDataManager.getRandomNum(6));
			productDto2.setProductUnitPrice(new BigDecimal(10));
			productDto2.setProductQty(1);
			
			ProductDto productDto3 = new ProductDto();
			
			productDto3.setProductId(bpw.get(2).get("ProductId").toString());
			productDto3.setCatalogId(TestDataManager.getRandomNum(6));
			productDto3.setProductUnitPrice(new BigDecimal(10));
			productDto3.setProductQty(2);
			
			List<ProductDto> productInfos = new ArrayList<>();
			productInfos.add(productDto1);
			productInfos.add(productDto2);
			productInfos.add(productDto3);

			SellerProductDto sellerProductDto = new SellerProductDto();
			sellerProductDto.setSellerId(sellerid);
			sellerProductDto.setProductInfos(productInfos);					
			
			List<SellerProductDto> sellerProducts = new ArrayList<>();
			sellerProducts.add(sellerProductDto);
			
			getsellerpromotioninfobyproductidsBean.setBuyerId(buyerid);
			getsellerpromotioninfobyproductidsBean.setSellerProductInfos(sellerProducts);
			
			getsellerpromotioninfobyproductidsCall.setData(getsellerpromotioninfobyproductidsBean);
			getsellerpromotioninfobyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getsellerpromotioninfobyproductidsCall.getCode(), "验证返回Code");
			
			ShoppingCartCalculateResp sellerProductsPromotionInfos = getsellerpromotioninfobyproductidsCall.getShoppingCartCalculateResp();
			Logger.verifyEquals(sellerid, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto validProductPromotionInfoDto = sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getValidPromotionInfos().get(0);
			
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(validProductPromotionInfoDto.getPromotionPolicyInfo(),false);
			Logger.verifyEquals(0, validProductPromotionInfoDto.getPromotionAmount().compareTo(BigDecimal.valueOf(32)), "验证返回PromotionAmount");

			List<ProductDto> returnProductDtos = validProductPromotionInfoDto.getProductInfos();
			
			for(int i=0;i<returnProductDtos.size();i++)
			{
				ProductDto productDto=getsellerpromotioninfobyproductidsBean.getSellerProductInfos().get(0).getProductInfos().get(i);
				Logger.verifyEquals(productDto.getProductId(), returnProductDtos.get(i).getProductId(), "验证返回ProductId");
				Logger.verifyEquals(productDto.getCatalogId(), returnProductDtos.get(i).getCatalogId(), "验证返回CatalogId");
				Logger.verifyEquals(productDto.getProductUnitPrice(), returnProductDtos.get(i).getProductUnitPrice(), "验证返回ProductUnitPrice");
				Logger.verifyEquals(productDto.getProductQty(), returnProductDtos.get(i).getProductQty(), "验证返回ProductQty");
				Logger.verifyEquals(productDto.getProductUnitPrice().multiply(new BigDecimal(productDto.getProductQty())), returnProductDtos.get(i).getProductTotalPrice(), "验证返回ProductTotalPrice");
				
				Logger.comment(returnProductDtos.get(i).getPromotionValue().toString()+":"+returnProductDtos.get(i).getProductTotalPrice().multiply(BigDecimal.valueOf(0.025)));
				Logger.verifyEquals(0, returnProductDtos.get(i).getPromotionValue().compareTo(returnProductDtos.get(i).getProductTotalPrice().multiply(BigDecimal.valueOf(0.8))), "验证返回PromotionValue");
			}
			
			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getInvalidPromotionInfos().size(),"验证InvalidPromotionInfos空");
			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getNonProductPromotionInfos().size(),"验证InvalidPromotionInfos空");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_GetSellerPromotionInfoByProductIds_017() {
		Logger.start(true,"购物车计算商品促销信息-根据商品Id集合获取商品促销信息-全场商品-单个商家-多件商品-满件折-不满足条件");
		try {
			int buyerid = TestDataManager.getRandomIntNum(6);			

			int sellerid = Integer.valueOf(EnvSetup.getData("couponSellerId"));			
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBean(sellerid, PromotionTypeEnum.DiscountIfCountEnough);
			int promotionId = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);
			
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(4);
			
			ProductDto productDto1 = new ProductDto();
			
			productDto1.setProductId(bpw.get(0).get("ProductId").toString());
			productDto1.setCatalogId(TestDataManager.getRandomNum(6));
			productDto1.setProductUnitPrice(new BigDecimal(10));
			productDto1.setProductQty(1);	
			
			ProductDto productDto2 = new ProductDto();
			
			productDto2.setProductId(bpw.get(1).get("ProductId").toString());
			productDto2.setCatalogId(TestDataManager.getRandomNum(6));
			productDto2.setProductUnitPrice(new BigDecimal(1));
			productDto2.setProductQty(1);
			
			ProductDto productDto3 = new ProductDto();
			
			productDto3.setProductId(bpw.get(2).get("ProductId").toString());
			productDto3.setCatalogId(TestDataManager.getRandomNum(6));
			productDto3.setProductUnitPrice(new BigDecimal(1));
			productDto3.setProductQty(2);
			
			List<ProductDto> productInfos = new ArrayList<>();
			productInfos.add(productDto1);
			productInfos.add(productDto2);
			productInfos.add(productDto3);
			
			SellerProductDto sellerProductDto = new SellerProductDto();
			sellerProductDto.setSellerId(sellerid);
			sellerProductDto.setProductInfos(productInfos);					
			
			List<SellerProductDto> sellerProducts = new ArrayList<>();
			sellerProducts.add(sellerProductDto);
			
			getsellerpromotioninfobyproductidsBean.setBuyerId(buyerid);
			getsellerpromotioninfobyproductidsBean.setSellerProductInfos(sellerProducts);
			
			getsellerpromotioninfobyproductidsCall.setData(getsellerpromotioninfobyproductidsBean);
			getsellerpromotioninfobyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getsellerpromotioninfobyproductidsCall.getCode(), "验证返回Code");
			
			ShoppingCartCalculateResp sellerProductsPromotionInfos = getsellerpromotioninfobyproductidsCall.getShoppingCartCalculateResp();
			Logger.verifyEquals(sellerid, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getSellerId(), "验证返回SellerId");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getValidPromotionInfos().size(), "验证返回ValidPromotionInfos");

			ProductPromotionInfoDto invalidProductPromotionInfoDto = sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getInvalidPromotionInfos().get(0);
			
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(invalidProductPromotionInfoDto.getPromotionPolicyInfo(),false);
			
			Logger.verifyEquals(0, invalidProductPromotionInfoDto.getPromotionAmount().compareTo(new BigDecimal(0)), "验证返回PromotionAmount");

			List<ProductDto> returnProductDtos = invalidProductPromotionInfoDto.getProductInfos();
			
			for(int i=0;i<returnProductDtos.size();i++)
			{
				ProductDto productDto=getsellerpromotioninfobyproductidsBean.getSellerProductInfos().get(0).getProductInfos().get(i);
				Logger.verifyEquals(productDto.getProductId(), returnProductDtos.get(i).getProductId(), "验证返回ProductId");
				Logger.verifyEquals(productDto.getCatalogId(), returnProductDtos.get(i).getCatalogId(), "验证返回CatalogId");
				Logger.verifyEquals(productDto.getProductUnitPrice(), returnProductDtos.get(i).getProductUnitPrice(), "验证返回ProductUnitPrice");
				Logger.verifyEquals(productDto.getProductQty(), returnProductDtos.get(i).getProductQty(), "验证返回ProductQty");
				Logger.verifyEquals(0, returnProductDtos.get(i).getProductTotalPrice().compareTo(returnProductDtos.get(i).getProductUnitPrice().multiply(BigDecimal.valueOf(returnProductDtos.get(i).getProductQty()))), "验证返回ProductTotalPrice");
				
				Logger.comment(returnProductDtos.get(i).getPromotionValue().toString()+":"+returnProductDtos.get(i).getProductTotalPrice().multiply(BigDecimal.valueOf(0.025)));
				Logger.verifyEquals(0, returnProductDtos.get(i).getPromotionValue().compareTo(BigDecimal.valueOf(0)), "验证返回PromotionValue");
			}
			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getNonProductPromotionInfos().size(),"验证InvalidPromotionInfos空");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_GetSellerPromotionInfoByProductIds_018() {
		Logger.start(true,"购物车计算商品促销信息-根据商品Id集合获取商品促销信息-全场商品-单个商家-多件商品-满金额减-满足条件");
		try {
			int buyerid = TestDataManager.getRandomIntNum(6);			

			int sellerid = Integer.valueOf(EnvSetup.getData("couponSellerId"));			
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBean(sellerid, PromotionTypeEnum.ReduceIfAmountEnough);
			createSellerPromotionBean.getPromotionInfo().getPromotionValues().get(0).setValue(new BigDecimal(2));
			int promotionId = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);
			
			List<String> productIds = new ArrayList<>();
			
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(4);
		
			ProductDto productDto1 = new ProductDto();
			
			productDto1.setProductId(bpw.get(0).get("ProductId").toString());
			productDto1.setCatalogId(TestDataManager.getRandomNum(6));
			productDto1.setProductUnitPrice(new BigDecimal(5));
			productDto1.setProductQty(2);	
			
			ProductDto productDto2 = new ProductDto();
			
			productDto2.setProductId(bpw.get(1).get("ProductId").toString());
			productDto2.setCatalogId(TestDataManager.getRandomNum(6));
			productDto2.setProductUnitPrice(new BigDecimal(10));
			productDto2.setProductQty(1);
			
			ProductDto productDto3 = new ProductDto();
			
			productDto3.setProductId(bpw.get(2).get("ProductId").toString());
			productDto3.setCatalogId(TestDataManager.getRandomNum(6));
			productDto3.setProductUnitPrice(new BigDecimal(10));
			productDto3.setProductQty(2);
			
			List<ProductDto> productInfos = new ArrayList<>();
			productInfos.add(productDto1);
			productInfos.add(productDto2);
			productInfos.add(productDto3);

			SellerProductDto sellerProductDto = new SellerProductDto();
			sellerProductDto.setSellerId(sellerid);
			sellerProductDto.setProductInfos(productInfos);					
			
			List<SellerProductDto> sellerProducts = new ArrayList<>();
			sellerProducts.add(sellerProductDto);
			
			getsellerpromotioninfobyproductidsBean.setBuyerId(buyerid);
			getsellerpromotioninfobyproductidsBean.setSellerProductInfos(sellerProducts);
			
			getsellerpromotioninfobyproductidsCall.setData(getsellerpromotioninfobyproductidsBean);
			getsellerpromotioninfobyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getsellerpromotioninfobyproductidsCall.getCode(), "验证返回Code");
			
			ShoppingCartCalculateResp sellerProductsPromotionInfos = getsellerpromotioninfobyproductidsCall.getShoppingCartCalculateResp();
			Logger.verifyEquals(sellerid, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto validProductPromotionInfoDto = sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getValidPromotionInfos().get(0);
			
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(validProductPromotionInfoDto.getPromotionPolicyInfo(),false);
			Logger.verifyEquals(0, validProductPromotionInfoDto.getPromotionAmount().compareTo(BigDecimal.valueOf(2)), "验证返回PromotionAmount");

			List<ProductDto> returnProductDtos = validProductPromotionInfoDto.getProductInfos();
			
			for(int i=0;i<returnProductDtos.size();i++)
			{
				ProductDto productDto=getsellerpromotioninfobyproductidsBean.getSellerProductInfos().get(0).getProductInfos().get(i);
				Logger.verifyEquals(productDto.getProductId(), returnProductDtos.get(i).getProductId(), "验证返回ProductId");
				Logger.verifyEquals(productDto.getCatalogId(), returnProductDtos.get(i).getCatalogId(), "验证返回CatalogId");
				Logger.verifyEquals(productDto.getProductUnitPrice(), returnProductDtos.get(i).getProductUnitPrice(), "验证返回ProductUnitPrice");
				Logger.verifyEquals(productDto.getProductQty(), returnProductDtos.get(i).getProductQty(), "验证返回ProductQty");
				Logger.verifyEquals(productDto.getProductUnitPrice().multiply(new BigDecimal(productDto.getProductQty())), returnProductDtos.get(i).getProductTotalPrice(), "验证返回ProductTotalPrice");
				
				Logger.comment(returnProductDtos.get(i).getPromotionValue().toString()+":"+returnProductDtos.get(i).getProductTotalPrice().multiply(BigDecimal.valueOf(0.025)));
				Logger.verifyEquals(0, returnProductDtos.get(i).getPromotionValue().compareTo(returnProductDtos.get(i).getProductTotalPrice().multiply(BigDecimal.valueOf(0.05))), "验证返回PromotionValue");
			}
			
			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getInvalidPromotionInfos().size(),"验证InvalidPromotionInfos空");
			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getNonProductPromotionInfos().size(),"验证InvalidPromotionInfos空");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_GetSellerPromotionInfoByProductIds_019() {
		Logger.start(true,"购物车计算商品促销信息-根据商品Id集合获取商品促销信息-全场商品-单个商家-多件商品-满金额减-不满足条件");
		try {
			int buyerid = TestDataManager.getRandomIntNum(6);			

			int sellerid = Integer.valueOf(EnvSetup.getData("couponSellerId"));			
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBean(sellerid, PromotionTypeEnum.ReduceIfAmountEnough);
			int promotionId = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);
			
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(4);
			
			ProductDto productDto1 = new ProductDto();
			
			productDto1.setProductId(bpw.get(0).get("ProductId").toString());
			productDto1.setCatalogId(TestDataManager.getRandomNum(6));
			productDto1.setProductUnitPrice(new BigDecimal(1));
			productDto1.setProductQty(1);	
			
			ProductDto productDto2 = new ProductDto();
			
			productDto2.setProductId(bpw.get(1).get("ProductId").toString());
			productDto2.setCatalogId(TestDataManager.getRandomNum(6));
			productDto2.setProductUnitPrice(new BigDecimal(1));
			productDto2.setProductQty(1);
			
			ProductDto productDto3 = new ProductDto();
			
			productDto3.setProductId(bpw.get(2).get("ProductId").toString());
			productDto3.setCatalogId(TestDataManager.getRandomNum(6));
			productDto3.setProductUnitPrice(new BigDecimal(1));
			productDto3.setProductQty(2);
			
			List<ProductDto> productInfos = new ArrayList<>();
			productInfos.add(productDto1);
			productInfos.add(productDto2);
			productInfos.add(productDto3);
			
			SellerProductDto sellerProductDto = new SellerProductDto();
			sellerProductDto.setSellerId(sellerid);
			sellerProductDto.setProductInfos(productInfos);					
			
			List<SellerProductDto> sellerProducts = new ArrayList<>();
			sellerProducts.add(sellerProductDto);
			
			getsellerpromotioninfobyproductidsBean.setBuyerId(buyerid);
			getsellerpromotioninfobyproductidsBean.setSellerProductInfos(sellerProducts);
			
			getsellerpromotioninfobyproductidsCall.setData(getsellerpromotioninfobyproductidsBean);
			getsellerpromotioninfobyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getsellerpromotioninfobyproductidsCall.getCode(), "验证返回Code");
			
			ShoppingCartCalculateResp sellerProductsPromotionInfos = getsellerpromotioninfobyproductidsCall.getShoppingCartCalculateResp();
			Logger.verifyEquals(sellerid, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getSellerId(), "验证返回SellerId");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getValidPromotionInfos().size(), "验证返回ValidPromotionInfos");

			ProductPromotionInfoDto invalidProductPromotionInfoDto = sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getInvalidPromotionInfos().get(0);
			
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(invalidProductPromotionInfoDto.getPromotionPolicyInfo(),false);
			
			Logger.verifyEquals(0, invalidProductPromotionInfoDto.getPromotionAmount().compareTo(new BigDecimal(0)), "验证返回PromotionAmount");

			List<ProductDto> returnProductDtos = invalidProductPromotionInfoDto.getProductInfos();
			
			for(int i=0;i<returnProductDtos.size();i++)
			{
				ProductDto productDto=getsellerpromotioninfobyproductidsBean.getSellerProductInfos().get(0).getProductInfos().get(i);
				Logger.verifyEquals(productDto.getProductId(), returnProductDtos.get(i).getProductId(), "验证返回ProductId");
				Logger.verifyEquals(productDto.getCatalogId(), returnProductDtos.get(i).getCatalogId(), "验证返回CatalogId");
				Logger.verifyEquals(productDto.getProductUnitPrice(), returnProductDtos.get(i).getProductUnitPrice(), "验证返回ProductUnitPrice");
				Logger.verifyEquals(productDto.getProductQty(), returnProductDtos.get(i).getProductQty(), "验证返回ProductQty");
				Logger.verifyEquals(0, returnProductDtos.get(i).getProductTotalPrice().compareTo(returnProductDtos.get(i).getProductUnitPrice().multiply(BigDecimal.valueOf(returnProductDtos.get(i).getProductQty()))), "验证返回ProductTotalPrice");
				
				Logger.comment(returnProductDtos.get(i).getPromotionValue().toString()+":"+returnProductDtos.get(i).getProductTotalPrice().multiply(BigDecimal.valueOf(0.025)));
				Logger.verifyEquals(0, returnProductDtos.get(i).getPromotionValue().compareTo(BigDecimal.valueOf(0)), "验证返回PromotionValue");
			}
			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getNonProductPromotionInfos().size(),"验证InvalidPromotionInfos空");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_GetSellerPromotionInfoByProductIds_020() {
		Logger.start(true,"购物车计算商品促销信息-根据商品Id集合获取商品促销信息-全场商品-单个商家-多件商品-满金额折-满足条件");
		try {
			int buyerid = TestDataManager.getRandomIntNum(6);			

			int sellerid = Integer.valueOf(EnvSetup.getData("couponSellerId"));			
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBean(sellerid, PromotionTypeEnum.DiscountIfAmountEnough);
			createSellerPromotionBean.getPromotionInfo().getPromotionValues().get(0).setValue(new BigDecimal(4));
			int promotionId = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);
			
			List<String> productIds = new ArrayList<>();
			
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(4);
		
			ProductDto productDto1 = new ProductDto();
			
			productDto1.setProductId(bpw.get(0).get("ProductId").toString());
			productDto1.setCatalogId(TestDataManager.getRandomNum(6));
			productDto1.setProductUnitPrice(new BigDecimal(5));
			productDto1.setProductQty(2);	
			
			ProductDto productDto2 = new ProductDto();
			
			productDto2.setProductId(bpw.get(1).get("ProductId").toString());
			productDto2.setCatalogId(TestDataManager.getRandomNum(6));
			productDto2.setProductUnitPrice(new BigDecimal(10));
			productDto2.setProductQty(1);
			
			ProductDto productDto3 = new ProductDto();
			
			productDto3.setProductId(bpw.get(2).get("ProductId").toString());
			productDto3.setCatalogId(TestDataManager.getRandomNum(6));
			productDto3.setProductUnitPrice(new BigDecimal(10));
			productDto3.setProductQty(2);
			
			List<ProductDto> productInfos = new ArrayList<>();
			productInfos.add(productDto1);
			productInfos.add(productDto2);
			productInfos.add(productDto3);

			SellerProductDto sellerProductDto = new SellerProductDto();
			sellerProductDto.setSellerId(sellerid);
			sellerProductDto.setProductInfos(productInfos);					
			
			List<SellerProductDto> sellerProducts = new ArrayList<>();
			sellerProducts.add(sellerProductDto);
			
			getsellerpromotioninfobyproductidsBean.setBuyerId(buyerid);
			getsellerpromotioninfobyproductidsBean.setSellerProductInfos(sellerProducts);
			
			getsellerpromotioninfobyproductidsCall.setData(getsellerpromotioninfobyproductidsBean);
			getsellerpromotioninfobyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getsellerpromotioninfobyproductidsCall.getCode(), "验证返回Code");
			
			ShoppingCartCalculateResp sellerProductsPromotionInfos = getsellerpromotioninfobyproductidsCall.getShoppingCartCalculateResp();
			Logger.verifyEquals(sellerid, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto validProductPromotionInfoDto = sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getValidPromotionInfos().get(0);
			
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(validProductPromotionInfoDto.getPromotionPolicyInfo(),false);
			Logger.verifyEquals(0, validProductPromotionInfoDto.getPromotionAmount().compareTo(BigDecimal.valueOf(24)), "验证返回PromotionAmount");

			List<ProductDto> returnProductDtos = validProductPromotionInfoDto.getProductInfos();
			
			for(int i=0;i<returnProductDtos.size();i++)
			{
				ProductDto productDto=getsellerpromotioninfobyproductidsBean.getSellerProductInfos().get(0).getProductInfos().get(i);
				Logger.verifyEquals(productDto.getProductId(), returnProductDtos.get(i).getProductId(), "验证返回ProductId");
				Logger.verifyEquals(productDto.getCatalogId(), returnProductDtos.get(i).getCatalogId(), "验证返回CatalogId");
				Logger.verifyEquals(productDto.getProductUnitPrice(), returnProductDtos.get(i).getProductUnitPrice(), "验证返回ProductUnitPrice");
				Logger.verifyEquals(productDto.getProductQty(), returnProductDtos.get(i).getProductQty(), "验证返回ProductQty");
				Logger.verifyEquals(productDto.getProductUnitPrice().multiply(new BigDecimal(productDto.getProductQty())), returnProductDtos.get(i).getProductTotalPrice(), "验证返回ProductTotalPrice");
				
				Logger.comment(returnProductDtos.get(i).getPromotionValue().toString()+":"+returnProductDtos.get(i).getProductTotalPrice().multiply(BigDecimal.valueOf(0.025)));
				Logger.verifyEquals(0, returnProductDtos.get(i).getPromotionValue().compareTo(returnProductDtos.get(i).getProductTotalPrice().multiply(BigDecimal.valueOf(0.6))), "验证返回PromotionValue");
			}
			
			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getInvalidPromotionInfos().size(),"验证InvalidPromotionInfos空");
			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getNonProductPromotionInfos().size(),"验证InvalidPromotionInfos空");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_GetSellerPromotionInfoByProductIds_021() {
		Logger.start(true,"购物车计算商品促销信息-根据商品Id集合获取商品促销信息-全场商品-单个商家-多件商品-满金额折-不满足条件");
		try {
			int buyerid = TestDataManager.getRandomIntNum(6);			

			int sellerid = Integer.valueOf(EnvSetup.getData("couponSellerId"));			
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBean(sellerid, PromotionTypeEnum.DiscountIfAmountEnough);
			int promotionId = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);
			
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(4);
			
			ProductDto productDto1 = new ProductDto();
			
			productDto1.setProductId(bpw.get(0).get("ProductId").toString());
			productDto1.setCatalogId(TestDataManager.getRandomNum(6));
			productDto1.setProductUnitPrice(new BigDecimal(1));
			productDto1.setProductQty(1);	
			
			ProductDto productDto2 = new ProductDto();
			
			productDto2.setProductId(bpw.get(1).get("ProductId").toString());
			productDto2.setCatalogId(TestDataManager.getRandomNum(6));
			productDto2.setProductUnitPrice(new BigDecimal(1));
			productDto2.setProductQty(1);
			
			ProductDto productDto3 = new ProductDto();
			
			productDto3.setProductId(bpw.get(2).get("ProductId").toString());
			productDto3.setCatalogId(TestDataManager.getRandomNum(6));
			productDto3.setProductUnitPrice(new BigDecimal(1));
			productDto3.setProductQty(2);
			
			List<ProductDto> productInfos = new ArrayList<>();
			productInfos.add(productDto1);
			productInfos.add(productDto2);
			productInfos.add(productDto3);
			
			SellerProductDto sellerProductDto = new SellerProductDto();
			sellerProductDto.setSellerId(sellerid);
			sellerProductDto.setProductInfos(productInfos);					
			
			List<SellerProductDto> sellerProducts = new ArrayList<>();
			sellerProducts.add(sellerProductDto);
			
			getsellerpromotioninfobyproductidsBean.setBuyerId(buyerid);
			getsellerpromotioninfobyproductidsBean.setSellerProductInfos(sellerProducts);
			
			getsellerpromotioninfobyproductidsCall.setData(getsellerpromotioninfobyproductidsBean);
			getsellerpromotioninfobyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getsellerpromotioninfobyproductidsCall.getCode(), "验证返回Code");
			
			ShoppingCartCalculateResp sellerProductsPromotionInfos = getsellerpromotioninfobyproductidsCall.getShoppingCartCalculateResp();
			Logger.verifyEquals(sellerid, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getSellerId(), "验证返回SellerId");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getValidPromotionInfos().size(), "验证返回ValidPromotionInfos");

			ProductPromotionInfoDto invalidProductPromotionInfoDto = sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getInvalidPromotionInfos().get(0);
			
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(invalidProductPromotionInfoDto.getPromotionPolicyInfo(),false);
			
			Logger.verifyEquals(0, invalidProductPromotionInfoDto.getPromotionAmount().compareTo(new BigDecimal(0)), "验证返回PromotionAmount");

			List<ProductDto> returnProductDtos = invalidProductPromotionInfoDto.getProductInfos();
			
			for(int i=0;i<returnProductDtos.size();i++)
			{
				ProductDto productDto=getsellerpromotioninfobyproductidsBean.getSellerProductInfos().get(0).getProductInfos().get(i);
				Logger.verifyEquals(productDto.getProductId(), returnProductDtos.get(i).getProductId(), "验证返回ProductId");
				Logger.verifyEquals(productDto.getCatalogId(), returnProductDtos.get(i).getCatalogId(), "验证返回CatalogId");
				Logger.verifyEquals(productDto.getProductUnitPrice(), returnProductDtos.get(i).getProductUnitPrice(), "验证返回ProductUnitPrice");
				Logger.verifyEquals(productDto.getProductQty(), returnProductDtos.get(i).getProductQty(), "验证返回ProductQty");
				Logger.verifyEquals(0, returnProductDtos.get(i).getProductTotalPrice().compareTo(returnProductDtos.get(i).getProductUnitPrice().multiply(BigDecimal.valueOf(returnProductDtos.get(i).getProductQty()))), "验证返回ProductTotalPrice");
				
				Logger.comment(returnProductDtos.get(i).getPromotionValue().toString()+":"+returnProductDtos.get(i).getProductTotalPrice().multiply(BigDecimal.valueOf(0.025)));
				Logger.verifyEquals(0, returnProductDtos.get(i).getPromotionValue().compareTo(BigDecimal.valueOf(0)), "验证返回PromotionValue");
			}
			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getNonProductPromotionInfos().size(),"验证InvalidPromotionInfos空");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_GetSellerPromotionInfoByProductIds_022() {
		Logger.start(true,"购物车计算商品促销信息-根据商品Id集合获取商品促销信息-全场商品-单个商家-多件商品-第二件半价-满足条件");
		try {
			int buyerid = TestDataManager.getRandomIntNum(6);			

			int sellerid = Integer.valueOf(EnvSetup.getData("couponSellerId"));			
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBean(sellerid, PromotionTypeEnum.HalfIfCountEnough);
			createSellerPromotionBean.getPromotionInfo().getPromotionValues().get(0).setValue(new BigDecimal(4));
			int promotionId = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);
			
			List<String> productIds = new ArrayList<>();
			
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(4);
		
			ProductDto productDto1 = new ProductDto();
			
			productDto1.setProductId(bpw.get(0).get("ProductId").toString());
			productDto1.setCatalogId(TestDataManager.getRandomNum(6));
			productDto1.setProductUnitPrice(new BigDecimal(5));
			productDto1.setProductQty(2);	
			
			ProductDto productDto2 = new ProductDto();
			
			productDto2.setProductId(bpw.get(1).get("ProductId").toString());
			productDto2.setCatalogId(TestDataManager.getRandomNum(6));
			productDto2.setProductUnitPrice(new BigDecimal(15));
			productDto2.setProductQty(1);
			
			ProductDto productDto3 = new ProductDto();
			
			productDto3.setProductId(bpw.get(2).get("ProductId").toString());
			productDto3.setCatalogId(TestDataManager.getRandomNum(6));
			productDto3.setProductUnitPrice(new BigDecimal(10));
			productDto3.setProductQty(3);
			
			List<ProductDto> productInfos = new ArrayList<>();
			productInfos.add(productDto1);
			productInfos.add(productDto2);
			productInfos.add(productDto3);

			SellerProductDto sellerProductDto = new SellerProductDto();
			sellerProductDto.setSellerId(sellerid);
			sellerProductDto.setProductInfos(productInfos);					
			
			List<SellerProductDto> sellerProducts = new ArrayList<>();
			sellerProducts.add(sellerProductDto);
			
			getsellerpromotioninfobyproductidsBean.setBuyerId(buyerid);
			getsellerpromotioninfobyproductidsBean.setSellerProductInfos(sellerProducts);
			
			getsellerpromotioninfobyproductidsCall.setData(getsellerpromotioninfobyproductidsBean);
			getsellerpromotioninfobyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getsellerpromotioninfobyproductidsCall.getCode(), "验证返回Code");
			
			ShoppingCartCalculateResp sellerProductsPromotionInfos = getsellerpromotioninfobyproductidsCall.getShoppingCartCalculateResp();
			Logger.verifyEquals(sellerid, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto validProductPromotionInfoDto = sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getValidPromotionInfos().get(0);
			
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(validProductPromotionInfoDto.getPromotionPolicyInfo(),false);
			Logger.verifyEquals(0, validProductPromotionInfoDto.getPromotionAmount().compareTo(BigDecimal.valueOf(12.5)), "验证返回PromotionAmount");

			List<ProductDto> returnProductDtos = validProductPromotionInfoDto.getProductInfos();
	//顺序变来变去的，不验了		
//			for(int i=0;i<returnProductDtos.size();i++)
//			{
//				ProductDto productDto=getsellerpromotioninfobyproductidsBean.getSellerProductInfos().get(0).getProductInfos().get(i);
//				Logger.verifyEquals(productDto.getProductId(), returnProductDtos.get(i).getProductId(), "验证返回ProductId");
//				Logger.verifyEquals(productDto.getCatalogId(), returnProductDtos.get(i).getCatalogId(), "验证返回CatalogId");
//				Logger.verifyEquals(productDto.getProductUnitPrice(), returnProductDtos.get(i).getProductUnitPrice(), "验证返回ProductUnitPrice");
//				Logger.verifyEquals(productDto.getProductQty(), returnProductDtos.get(i).getProductQty(), "验证返回ProductQty");
//				Logger.verifyEquals(productDto.getProductUnitPrice().multiply(new BigDecimal(productDto.getProductQty())), returnProductDtos.get(i).getProductTotalPrice(), "验证返回ProductTotalPrice");
//				
//				Logger.comment(returnProductDtos.get(i).getPromotionValue().toString()+":"+returnProductDtos.get(i).getProductTotalPrice().multiply(BigDecimal.valueOf(0.025)));
//			}
//			
//			ProductDto productDto=getsellerpromotioninfobyproductidsBean.getSellerProductInfos().get(0).getProductInfos().get(2);
//			Logger.verifyEquals(productDto.getProductId(), returnProductDtos.get(0).getProductId(), "验证返回ProductId");
//			Logger.verifyEquals(productDto.getCatalogId(), returnProductDtos.get(0).getCatalogId(), "验证返回CatalogId");
//			Logger.verifyEquals(productDto.getProductUnitPrice(), returnProductDtos.get(0).getProductUnitPrice(), "验证返回ProductUnitPrice");
//			Logger.verifyEquals(productDto.getProductQty(), returnProductDtos.get(0).getProductQty(), "验证返回ProductQty");
//			Logger.verifyEquals(productDto.getProductUnitPrice().multiply(new BigDecimal(productDto.getProductQty())), returnProductDtos.get(0).getProductTotalPrice(), "验证返回ProductTotalPrice");
//			
//			 productDto=getsellerpromotioninfobyproductidsBean.getSellerProductInfos().get(0).getProductInfos().get(0);
//				Logger.verifyEquals(productDto.getProductId(), returnProductDtos.get(1).getProductId(), "验证返回ProductId");
//				Logger.verifyEquals(productDto.getCatalogId(), returnProductDtos.get(1).getCatalogId(), "验证返回CatalogId");
//				Logger.verifyEquals(productDto.getProductUnitPrice(), returnProductDtos.get(1).getProductUnitPrice(), "验证返回ProductUnitPrice");
//				Logger.verifyEquals(productDto.getProductQty(), returnProductDtos.get(1).getProductQty(), "验证返回ProductQty");
//				Logger.verifyEquals(productDto.getProductUnitPrice().multiply(new BigDecimal(productDto.getProductQty())), returnProductDtos.get(1).getProductTotalPrice(), "验证返回ProductTotalPrice");
//				
//				 productDto=getsellerpromotioninfobyproductidsBean.getSellerProductInfos().get(0).getProductInfos().get(1);
//					Logger.verifyEquals(productDto.getProductId(), returnProductDtos.get(2).getProductId(), "验证返回ProductId");
//					Logger.verifyEquals(productDto.getCatalogId(), returnProductDtos.get(2).getCatalogId(), "验证返回CatalogId");
//					Logger.verifyEquals(productDto.getProductUnitPrice(), returnProductDtos.get(2).getProductUnitPrice(), "验证返回ProductUnitPrice");
//					Logger.verifyEquals(productDto.getProductQty(), returnProductDtos.get(2).getProductQty(), "验证返回ProductQty");
//					Logger.verifyEquals(productDto.getProductUnitPrice().multiply(new BigDecimal(productDto.getProductQty())), returnProductDtos.get(2).getProductTotalPrice(), "验证返回ProductTotalPrice");
					
				
			// 验证优惠金额
//			Logger.verifyEquals(0, returnProductDtos.get(0).getPromotionValue().compareTo(BigDecimal.valueOf(10)), "验证返回PromotionValue");
//			Logger.verifyEquals(0, returnProductDtos.get(1).getPromotionValue().compareTo(BigDecimal.valueOf(2.5)), "验证返回PromotionValue");
//			Logger.verifyEquals(0, returnProductDtos.get(2).getPromotionValue().compareTo(BigDecimal.valueOf(0)), "验证返回PromotionValue");

			// 验证第二件半价的组合，单件价格从高到低排，两两组合
			List<HalfPriceProductPromotionDto>  halfPriceProductPromotions = validProductPromotionInfoDto.getPromotionProductInfos();
			
			// 第一对组合
			Logger.verifyEquals(0, halfPriceProductPromotions.get(0).getPromotionAmount().compareTo(BigDecimal.valueOf(5)), "验证返回PromotionAmount");
			Logger.verifyEquals(productDto2.getProductId(), halfPriceProductPromotions.get(0).getPromotionCatalogInfos().get(0).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto2.getCatalogId(), halfPriceProductPromotions.get(0).getPromotionCatalogInfos().get(0).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(1, halfPriceProductPromotions.get(0).getPromotionCatalogInfos().get(0).getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto3.getProductId(), halfPriceProductPromotions.get(0).getPromotionCatalogInfos().get(1).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto3.getCatalogId(), halfPriceProductPromotions.get(0).getPromotionCatalogInfos().get(1).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(1, halfPriceProductPromotions.get(0).getPromotionCatalogInfos().get(1).getProductQty(), "验证返回ProductQty");
			
			// 第二对组合
			Logger.verifyEquals(0, halfPriceProductPromotions.get(1).getPromotionAmount().compareTo(BigDecimal.valueOf(5)), "验证返回PromotionAmount");
			Logger.verifyEquals(productDto3.getProductId(), halfPriceProductPromotions.get(1).getPromotionCatalogInfos().get(0).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto3.getCatalogId(), halfPriceProductPromotions.get(1).getPromotionCatalogInfos().get(0).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(1, halfPriceProductPromotions.get(1).getPromotionCatalogInfos().get(0).getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto3.getProductId(), halfPriceProductPromotions.get(1).getPromotionCatalogInfos().get(1).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto3.getCatalogId(), halfPriceProductPromotions.get(1).getPromotionCatalogInfos().get(1).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(1, halfPriceProductPromotions.get(1).getPromotionCatalogInfos().get(1).getProductQty(), "验证返回ProductQty");
						
			// 第二对组合
			Logger.verifyEquals(0, halfPriceProductPromotions.get(2).getPromotionAmount().compareTo(BigDecimal.valueOf(2.5)), "验证返回PromotionAmount");
			Logger.verifyEquals(productDto1.getProductId(), halfPriceProductPromotions.get(2).getPromotionCatalogInfos().get(0).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto1.getCatalogId(), halfPriceProductPromotions.get(2).getPromotionCatalogInfos().get(0).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(1, halfPriceProductPromotions.get(2).getPromotionCatalogInfos().get(0).getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto1.getProductId(), halfPriceProductPromotions.get(2).getPromotionCatalogInfos().get(1).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto1.getCatalogId(), halfPriceProductPromotions.get(2).getPromotionCatalogInfos().get(1).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(1, halfPriceProductPromotions.get(2).getPromotionCatalogInfos().get(1).getProductQty(), "验证返回ProductQty");
										
			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getInvalidPromotionInfos().size(),"验证InvalidPromotionInfos空");
			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getNonProductPromotionInfos().size(),"验证InvalidPromotionInfos空");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_GetSellerPromotionInfoByProductIds_023() {
		Logger.start(true,"购物车计算商品促销信息-根据商品Id集合获取商品促销信息-全场商品-单个商家-多件商品-第二件半价-不满足条件");
		try {
			int buyerid = TestDataManager.getRandomIntNum(6);			

			int sellerid = Integer.valueOf(EnvSetup.getData("couponSellerId"));			
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBean(sellerid, PromotionTypeEnum.HalfIfCountEnough);
			int promotionId = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);
			
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(4);
			
			ProductDto productDto1 = new ProductDto();
			
			productDto1.setProductId(bpw.get(0).get("ProductId").toString());
			productDto1.setCatalogId(TestDataManager.getRandomNum(6));
			productDto1.setProductUnitPrice(new BigDecimal(1));
			productDto1.setProductQty(1);	
			
			List<ProductDto> productInfos = new ArrayList<>();
			productInfos.add(productDto1);
			
			SellerProductDto sellerProductDto = new SellerProductDto();
			sellerProductDto.setSellerId(sellerid);
			sellerProductDto.setProductInfos(productInfos);					
			
			List<SellerProductDto> sellerProducts = new ArrayList<>();
			sellerProducts.add(sellerProductDto);
			
			getsellerpromotioninfobyproductidsBean.setBuyerId(buyerid);
			getsellerpromotioninfobyproductidsBean.setSellerProductInfos(sellerProducts);
			
			getsellerpromotioninfobyproductidsCall.setData(getsellerpromotioninfobyproductidsBean);
			getsellerpromotioninfobyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getsellerpromotioninfobyproductidsCall.getCode(), "验证返回Code");
			
			ShoppingCartCalculateResp sellerProductsPromotionInfos = getsellerpromotioninfobyproductidsCall.getShoppingCartCalculateResp();
			Logger.verifyEquals(sellerid, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getSellerId(), "验证返回SellerId");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getValidPromotionInfos().size(), "验证返回ValidPromotionInfos");

			ProductPromotionInfoDto invalidProductPromotionInfoDto = sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getInvalidPromotionInfos().get(0);
			
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(invalidProductPromotionInfoDto.getPromotionPolicyInfo(),false);
			
			Logger.verifyEquals(0, invalidProductPromotionInfoDto.getPromotionAmount().compareTo(new BigDecimal(0)), "验证返回PromotionAmount");

			List<ProductDto> returnProductDtos = invalidProductPromotionInfoDto.getProductInfos();
			
			for(int i=0;i<returnProductDtos.size();i++)
			{
				ProductDto productDto=getsellerpromotioninfobyproductidsBean.getSellerProductInfos().get(0).getProductInfos().get(i);
				Logger.verifyEquals(productDto.getProductId(), returnProductDtos.get(i).getProductId(), "验证返回ProductId");
				Logger.verifyEquals(productDto.getCatalogId(), returnProductDtos.get(i).getCatalogId(), "验证返回CatalogId");
				Logger.verifyEquals(productDto.getProductUnitPrice(), returnProductDtos.get(i).getProductUnitPrice(), "验证返回ProductUnitPrice");
				Logger.verifyEquals(productDto.getProductQty(), returnProductDtos.get(i).getProductQty(), "验证返回ProductQty");
				Logger.verifyEquals(0, returnProductDtos.get(i).getProductTotalPrice().compareTo(returnProductDtos.get(i).getProductUnitPrice().multiply(BigDecimal.valueOf(returnProductDtos.get(i).getProductQty()))), "验证返回ProductTotalPrice");
				
				Logger.comment(returnProductDtos.get(i).getPromotionValue().toString()+":"+returnProductDtos.get(i).getProductTotalPrice().multiply(BigDecimal.valueOf(0.025)));
				Logger.verifyEquals(0, returnProductDtos.get(i).getPromotionValue().compareTo(BigDecimal.valueOf(0)), "验证返回PromotionValue");
			}
			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getNonProductPromotionInfos().size(),"验证InvalidPromotionInfos空");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetSellerPromotionInfoByProductIds_024() {
		Logger.start(true,"购物车计算商品促销信息-根据商品Id集合获取商品促销信息-排除商品-多个商家-多件商品-部分商品满足条件-满件减");
		try {
			int buyerid = TestDataManager.getRandomIntNum(6);			

			int sellerid1 = TestDataManager.getRandomIntNum(6);		
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid1);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBeanForExcludeProduct(sellerid1, PromotionTypeEnum.ReduceIfCountEnough);
			int promotionId = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);
								
			ProductDto productDto1 = new ProductDto();
			
			productDto1.setProductId(createSellerPromotionBean.getPromotionInfo().getProductIds().get(0));
			productDto1.setCatalogId(TestDataManager.getRandomNum(6));
			productDto1.setProductUnitPrice(new BigDecimal(5));
			productDto1.setProductQty(2);	
			
			ProductDto productDto2 = new ProductDto();
			
			productDto2.setProductId(TestDataManager.getRandomNum(20));
			productDto2.setCatalogId(TestDataManager.getRandomNum(6));
			productDto2.setProductUnitPrice(new BigDecimal(10));
			productDto2.setProductQty(1);
			
			ProductDto productDto3 = new ProductDto();
			
			productDto3.setProductId(TestDataManager.getRandomNum(20));
			productDto3.setCatalogId(TestDataManager.getRandomNum(6));
			productDto3.setProductUnitPrice(new BigDecimal(10));
			productDto3.setProductQty(2);
			
			List<ProductDto> productInfos1 = new ArrayList<>();
			productInfos1.add(productDto1);
			productInfos1.add(productDto2);
			productInfos1.add(productDto3);

			SellerProductDto sellerProductDto1 = new SellerProductDto();
			sellerProductDto1.setSellerId(sellerid1);
			sellerProductDto1.setProductInfos(productInfos1);	
			
			int sellerid2 = TestDataManager.getRandomIntNum(6);		
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid2);

			createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBeanForExcludeProduct(sellerid2, PromotionTypeEnum.ReduceIfCountEnough);
			
			List<String> productIds = new ArrayList<>();
			
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(8);

			productIds.add(bpw.get(4).get("ProductId").toString());
			productIds.add(bpw.get(5).get("ProductId").toString());
			productIds.add(bpw.get(6).get("ProductId").toString());
			productIds.add(bpw.get(7).get("ProductId").toString());
			
			createSellerPromotionBean.getPromotionInfo().setProductIds(productIds);
			
			int promotionId2 = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);
								
			ProductDto productDto4 = new ProductDto();
			
			productDto4.setProductId(createSellerPromotionBean.getPromotionInfo().getProductIds().get(0));
			productDto4.setCatalogId(TestDataManager.getRandomNum(6));
			productDto4.setProductUnitPrice(new BigDecimal(5));
			productDto4.setProductQty(2);	
			
			ProductDto productDto5 = new ProductDto();
			
			productDto5.setProductId(createSellerPromotionBean.getPromotionInfo().getProductIds().get(2));
			productDto5.setCatalogId(TestDataManager.getRandomNum(6));
			productDto5.setProductUnitPrice(new BigDecimal(10));
			productDto5.setProductQty(1);
			
			ProductDto productDto6 = new ProductDto();
			
			productDto6.setProductId(TestDataManager.getRandomNum(20));
			productDto6.setCatalogId(TestDataManager.getRandomNum(6));
			productDto6.setProductUnitPrice(new BigDecimal(10));
			productDto6.setProductQty(2);
			
			List<ProductDto> productInfos2 = new ArrayList<>();
			productInfos2.add(productDto4);
			productInfos2.add(productDto5);
			productInfos2.add(productDto6);

			SellerProductDto sellerProductDto2 = new SellerProductDto();
			sellerProductDto2.setSellerId(sellerid2);
			sellerProductDto2.setProductInfos(productInfos2);			
			
			List<SellerProductDto> sellerProducts = new ArrayList<>();
			sellerProducts.add(sellerProductDto1);
			sellerProducts.add(sellerProductDto2);

			getsellerpromotioninfobyproductidsBean.setBuyerId(buyerid);
			getsellerpromotioninfobyproductidsBean.setSellerProductInfos(sellerProducts);
			
			getsellerpromotioninfobyproductidsCall.setData(getsellerpromotioninfobyproductidsBean);
			getsellerpromotioninfobyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getsellerpromotioninfobyproductidsCall.getCode(), "验证返回Code");
			
			ShoppingCartCalculateResp sellerProductsPromotionInfos = getsellerpromotioninfobyproductidsCall.getShoppingCartCalculateResp();
			List<ShoppingCartSellerPromotionDto>  shoppingCartSellerPromotions = sellerProductsPromotionInfos.getSellerProductsPromotionInfos();
			
			for(int j=0;j<shoppingCartSellerPromotions.size();j++)
			{
			Logger.verifyEquals(getsellerpromotioninfobyproductidsBean.getSellerProductInfos().get(j).getSellerId(), sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(j).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto validProductPromotionInfoDto = sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(j).getValidPromotionInfos().get(0);
			
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(validProductPromotionInfoDto.getPromotionPolicyInfo(),false);
			Logger.verifyEquals(createSellerPromotionBean.getPromotionInfo().getPromotionValues().get(0).getValue(), validProductPromotionInfoDto.getPromotionAmount(), "验证返回PromotionAmount");
			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getInvalidPromotionInfos().size(),"验证InvalidPromotionInfos空");
			}
			
			List<ProductDto> returnProductDtos1 = shoppingCartSellerPromotions.get(0).getValidPromotionInfos().get(0).getProductInfos();
			Logger.verifyEquals(productDto2.getProductId(), returnProductDtos1.get(0).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto2.getCatalogId(), returnProductDtos1.get(0).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto2.getProductUnitPrice(), returnProductDtos1.get(0).getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto2.getProductQty(), returnProductDtos1.get(0).getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto2.getProductUnitPrice().multiply(new BigDecimal(productDto2.getProductQty())), returnProductDtos1.get(0).getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, returnProductDtos1.get(0).getPromotionValue().compareTo(BigDecimal.valueOf(0.33)), "验证返回PromotionValue");
		
			Logger.verifyEquals(productDto3.getProductId(), returnProductDtos1.get(1).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto3.getCatalogId(), returnProductDtos1.get(1).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto3.getProductUnitPrice(), returnProductDtos1.get(1).getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto3.getProductQty(), returnProductDtos1.get(1).getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto3.getProductUnitPrice().multiply(new BigDecimal(productDto3.getProductQty())), returnProductDtos1.get(1).getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, returnProductDtos1.get(1).getPromotionValue().compareTo(BigDecimal.valueOf(0.67)), "验证返回PromotionValue");
		
			List<ProductDto> returnProductDtos2 = shoppingCartSellerPromotions.get(1).getValidPromotionInfos().get(0).getProductInfos();
			Logger.verifyEquals(productDto6.getProductId(), returnProductDtos2.get(0).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto6.getCatalogId(), returnProductDtos2.get(0).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto6.getProductUnitPrice(), returnProductDtos2.get(0).getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto6.getProductQty(), returnProductDtos2.get(0).getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto6.getProductUnitPrice().multiply(new BigDecimal(productDto6.getProductQty())), returnProductDtos2.get(0).getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, returnProductDtos2.get(0).getPromotionValue().compareTo(BigDecimal.valueOf(1)), "验证返回PromotionValue");
		
			// 验证NonProductPromotionInfos
			List<ProductDto> returnProductDtos3 = shoppingCartSellerPromotions.get(0).getNonProductPromotionInfos().get(0).getProductInfos();
			Logger.verifyEquals(productDto1.getProductId(), returnProductDtos3.get(0).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto1.getCatalogId(), returnProductDtos3.get(0).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto1.getProductUnitPrice(), returnProductDtos3.get(0).getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto1.getProductQty(), returnProductDtos3.get(0).getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto1.getProductUnitPrice().multiply(new BigDecimal(productDto1.getProductQty())), returnProductDtos3.get(0).getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, returnProductDtos3.get(0).getPromotionValue().compareTo(BigDecimal.valueOf(0)), "验证返回PromotionValue");
		
			List<ProductDto> returnProductDtos4 = shoppingCartSellerPromotions.get(1).getNonProductPromotionInfos().get(0).getProductInfos();
			Logger.verifyEquals(productDto4.getProductId(), returnProductDtos4.get(0).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto4.getCatalogId(), returnProductDtos4.get(0).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto4.getProductUnitPrice(), returnProductDtos4.get(0).getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto4.getProductQty(), returnProductDtos4.get(0).getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto4.getProductUnitPrice().multiply(new BigDecimal(productDto4.getProductQty())), returnProductDtos4.get(0).getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, returnProductDtos4.get(0).getPromotionValue().compareTo(BigDecimal.valueOf(0)), "验证返回PromotionValue");
		
			Logger.verifyEquals(productDto5.getProductId(), returnProductDtos4.get(1).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto5.getCatalogId(), returnProductDtos4.get(1).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto5.getProductUnitPrice(), returnProductDtos4.get(1).getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto5.getProductQty(), returnProductDtos4.get(1).getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto5.getProductUnitPrice().multiply(new BigDecimal(productDto5.getProductQty())), returnProductDtos4.get(1).getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, returnProductDtos4.get(1).getPromotionValue().compareTo(BigDecimal.valueOf(0)), "验证返回PromotionValue");
		
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetSellerPromotionInfoByProductIds_025() {
		Logger.start(true,"购物车计算商品促销信息-根据商品Id集合获取商品促销信息-排除商品-多个商家-多件商品-部分商品满足条件-满件折+满件减");
		try {
			int buyerid = TestDataManager.getRandomIntNum(6);			

			int sellerid1 = TestDataManager.getRandomIntNum(6);		
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid1);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBeanForExcludeProduct(sellerid1, PromotionTypeEnum.DiscountIfCountEnough);
			createSellerPromotionBean.getPromotionInfo().getPromotionValues().get(0).setQtyCondition(3);
			int promotionId = JSellerPromotionCallService.CreateOldSellerPromotion(createSellerPromotionBean);
								
			ProductDto productDto1 = new ProductDto();
			
			productDto1.setProductId(createSellerPromotionBean.getPromotionInfo().getProductIds().get(0));
			productDto1.setCatalogId(TestDataManager.getRandomNum(6));
			productDto1.setProductUnitPrice(new BigDecimal(5));
			productDto1.setProductQty(2);	
			
			ProductDto productDto2 = new ProductDto();
			
			productDto2.setProductId(TestDataManager.getRandomNum(20));
			productDto2.setCatalogId(TestDataManager.getRandomNum(6));
			productDto2.setProductUnitPrice(new BigDecimal(10));
			productDto2.setProductQty(1);
			
			ProductDto productDto3 = new ProductDto();
			
			productDto3.setProductId(TestDataManager.getRandomNum(20));
			productDto3.setCatalogId(TestDataManager.getRandomNum(6));
			productDto3.setProductUnitPrice(new BigDecimal(10));
			productDto3.setProductQty(2);
			
			List<ProductDto> productInfos1 = new ArrayList<>();
			productInfos1.add(productDto1);
			productInfos1.add(productDto2);
			productInfos1.add(productDto3);

			SellerProductDto sellerProductDto1 = new SellerProductDto();
			sellerProductDto1.setSellerId(sellerid1);
			sellerProductDto1.setProductInfos(productInfos1);	
			
			int sellerid2 = TestDataManager.getRandomIntNum(6);		
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid2);

			createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBeanForExcludeProduct(sellerid2, PromotionTypeEnum.ReduceIfCountEnough);
			createSellerPromotionBean.getPromotionInfo().getPromotionValues().get(0).setQtyCondition(3);
				
			List<String> productIds = new ArrayList<>();
			
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(8);

			productIds.add(bpw.get(4).get("ProductId").toString());
			productIds.add(bpw.get(5).get("ProductId").toString());
			productIds.add(bpw.get(6).get("ProductId").toString());
			productIds.add(bpw.get(7).get("ProductId").toString());
			
			createSellerPromotionBean.getPromotionInfo().setProductIds(productIds);
			
			int promotionId2 = JSellerPromotionCallService.CreateOldSellerPromotion(createSellerPromotionBean);

			Thread.sleep(1000);

			ProductDto productDto4 = new ProductDto();
			
			productDto4.setProductId(createSellerPromotionBean.getPromotionInfo().getProductIds().get(0));
			productDto4.setCatalogId(TestDataManager.getRandomNum(6));
			productDto4.setProductUnitPrice(new BigDecimal(5));
			productDto4.setProductQty(2);	
			
			ProductDto productDto5 = new ProductDto();
			
			productDto5.setProductId(createSellerPromotionBean.getPromotionInfo().getProductIds().get(2));
			productDto5.setCatalogId(TestDataManager.getRandomNum(6));
			productDto5.setProductUnitPrice(new BigDecimal(10));
			productDto5.setProductQty(1);
			
			ProductDto productDto6 = new ProductDto();
			
			productDto6.setProductId(TestDataManager.getRandomNum(20));
			productDto6.setCatalogId(TestDataManager.getRandomNum(6));
			productDto6.setProductUnitPrice(new BigDecimal(10));
			productDto6.setProductQty(2);
			
			List<ProductDto> productInfos2 = new ArrayList<>();
			productInfos2.add(productDto4);
			productInfos2.add(productDto5);
			productInfos2.add(productDto6);

			SellerProductDto sellerProductDto2 = new SellerProductDto();
			sellerProductDto2.setSellerId(sellerid2);
			sellerProductDto2.setProductInfos(productInfos2);			
			
			List<SellerProductDto> sellerProducts = new ArrayList<>();
			sellerProducts.add(sellerProductDto1);
			sellerProducts.add(sellerProductDto2);

			getsellerpromotioninfobyproductidsBean.setBuyerId(buyerid);
			getsellerpromotioninfobyproductidsBean.setSellerProductInfos(sellerProducts);
			
			getsellerpromotioninfobyproductidsCall.setData(getsellerpromotioninfobyproductidsBean);
			getsellerpromotioninfobyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getsellerpromotioninfobyproductidsCall.getCode(), "验证返回Code");
			
			ShoppingCartCalculateResp sellerProductsPromotionInfos = getsellerpromotioninfobyproductidsCall.getShoppingCartCalculateResp();
			List<ShoppingCartSellerPromotionDto>  shoppingCartSellerPromotions = sellerProductsPromotionInfos.getSellerProductsPromotionInfos();
			
			for(int j=0;j<shoppingCartSellerPromotions.size();j++)
			{
			Logger.verifyEquals(getsellerpromotioninfobyproductidsBean.getSellerProductInfos().get(j).getSellerId(), sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(j).getSellerId(), "验证返回SellerId");
			}
			
			ProductPromotionInfoDto validProductPromotionInfoDto = sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getValidPromotionInfos().get(0);
			
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(validProductPromotionInfoDto.getPromotionPolicyInfo(),false);
			Logger.verifyEquals(0, validProductPromotionInfoDto.getPromotionAmount().compareTo(BigDecimal.valueOf(27)), "验证返回PromotionAmount");
			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getInvalidPromotionInfos().size(),"验证InvalidPromotionInfos空");
		
			validProductPromotionInfoDto = sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(1).getInvalidPromotionInfos().get(0);
			
			promotionInfoVerify.verifyPromotionPolicyInDB(validProductPromotionInfoDto.getPromotionPolicyInfo(),false);
			Logger.verifyEquals(0, validProductPromotionInfoDto.getPromotionAmount().compareTo(BigDecimal.valueOf(0)), "验证返回PromotionAmount");
			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(1).getValidPromotionInfos().size(),"验证InvalidPromotionInfos空");
		
			List<ProductDto> returnProductDtos1 = shoppingCartSellerPromotions.get(0).getValidPromotionInfos().get(0).getProductInfos();
			Logger.verifyEquals(productDto2.getProductId(), returnProductDtos1.get(0).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto2.getCatalogId(), returnProductDtos1.get(0).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto2.getProductUnitPrice(), returnProductDtos1.get(0).getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto2.getProductQty(), returnProductDtos1.get(0).getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto2.getProductUnitPrice().multiply(new BigDecimal(productDto2.getProductQty())), returnProductDtos1.get(0).getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, returnProductDtos1.get(0).getPromotionValue().compareTo(BigDecimal.valueOf(9)), "验证返回PromotionValue");
		
			Logger.verifyEquals(productDto3.getProductId(), returnProductDtos1.get(1).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto3.getCatalogId(), returnProductDtos1.get(1).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto3.getProductUnitPrice(), returnProductDtos1.get(1).getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto3.getProductQty(), returnProductDtos1.get(1).getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto3.getProductUnitPrice().multiply(new BigDecimal(productDto3.getProductQty())), returnProductDtos1.get(1).getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, returnProductDtos1.get(1).getPromotionValue().compareTo(BigDecimal.valueOf(18)), "验证返回PromotionValue");
		
			List<ProductDto> returnProductDtos2 = shoppingCartSellerPromotions.get(1).getInvalidPromotionInfos().get(0).getProductInfos();
			Logger.verifyEquals(productDto6.getProductId(), returnProductDtos2.get(0).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto6.getCatalogId(), returnProductDtos2.get(0).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto6.getProductUnitPrice(), returnProductDtos2.get(0).getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto6.getProductQty(), returnProductDtos2.get(0).getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto6.getProductUnitPrice().multiply(new BigDecimal(productDto6.getProductQty())), returnProductDtos2.get(0).getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, returnProductDtos2.get(0).getPromotionValue().compareTo(BigDecimal.valueOf(0)), "验证返回PromotionValue");
		
			// 验证NonProductPromotionInfos
			List<ProductDto> returnProductDtos3 = shoppingCartSellerPromotions.get(0).getNonProductPromotionInfos().get(0).getProductInfos();
			Logger.verifyEquals(productDto1.getProductId(), returnProductDtos3.get(0).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto1.getCatalogId(), returnProductDtos3.get(0).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto1.getProductUnitPrice(), returnProductDtos3.get(0).getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto1.getProductQty(), returnProductDtos3.get(0).getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto1.getProductUnitPrice().multiply(new BigDecimal(productDto1.getProductQty())), returnProductDtos3.get(0).getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, returnProductDtos3.get(0).getPromotionValue().compareTo(BigDecimal.valueOf(0)), "验证返回PromotionValue");
		
			List<ProductDto> returnProductDtos4 = shoppingCartSellerPromotions.get(1).getNonProductPromotionInfos().get(0).getProductInfos();
			Logger.verifyEquals(productDto4.getProductId(), returnProductDtos4.get(0).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto4.getCatalogId(), returnProductDtos4.get(0).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto4.getProductUnitPrice(), returnProductDtos4.get(0).getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto4.getProductQty(), returnProductDtos4.get(0).getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto4.getProductUnitPrice().multiply(new BigDecimal(productDto4.getProductQty())), returnProductDtos4.get(0).getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, returnProductDtos4.get(0).getPromotionValue().compareTo(BigDecimal.valueOf(0)), "验证返回PromotionValue");
		
			Logger.verifyEquals(productDto5.getProductId(), returnProductDtos4.get(1).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto5.getCatalogId(), returnProductDtos4.get(1).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto5.getProductUnitPrice(), returnProductDtos4.get(1).getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto5.getProductQty(), returnProductDtos4.get(1).getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto5.getProductUnitPrice().multiply(new BigDecimal(productDto5.getProductQty())), returnProductDtos4.get(1).getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, returnProductDtos4.get(1).getPromotionValue().compareTo(BigDecimal.valueOf(0)), "验证返回PromotionValue");
		
			String url = getsellerpromotioninfobyproductidsCall.getUrl();
			url=url.replace("reachpromotion.iapi.ymatou.com", "sellerpromotion.api.ymatou.com");
		
			getsellerpromotioninfobyproductidsCall.setUrl(url);
			
			getsellerpromotioninfobyproductidsCall.callService();	
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetSellerPromotionInfoByProductIds_026() {
		Logger.start(true,"购物车计算商品促销信息-根据商品Id集合获取商品促销信息-排除商品-多个商家-多件商品-部分商品满足条件-满金额减+满减减");
		try {
			int buyerid = TestDataManager.getRandomIntNum(6);			

			int sellerid1 = TestDataManager.getRandomIntNum(6    );		
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid1);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBeanForExcludeProduct(sellerid1, PromotionTypeEnum.ReduceIfAmountEnough);
			int promotionId = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);
								
			ProductDto productDto1 = new ProductDto();
			
			productDto1.setProductId(createSellerPromotionBean.getPromotionInfo().getProductIds().get(0));
			productDto1.setCatalogId(TestDataManager.getRandomNum(6));
			productDto1.setProductUnitPrice(new BigDecimal(5));
			productDto1.setProductQty(2);	
			
			ProductDto productDto2 = new ProductDto();
			
			productDto2.setProductId(TestDataManager.getRandomNum(20));
			productDto2.setCatalogId(TestDataManager.getRandomNum(6));
			productDto2.setProductUnitPrice(new BigDecimal(4));
			productDto2.setProductQty(1);
			
			ProductDto productDto3 = new ProductDto();
			
			productDto3.setProductId(TestDataManager.getRandomNum(20));
			productDto3.setCatalogId(TestDataManager.getRandomNum(6));
			productDto3.setProductUnitPrice(new BigDecimal(8));
			productDto3.setProductQty(2);
			
			List<ProductDto> productInfos1 = new ArrayList<>();
			productInfos1.add(productDto1);
			productInfos1.add(productDto2);
			productInfos1.add(productDto3);

			SellerProductDto sellerProductDto1 = new SellerProductDto();
			sellerProductDto1.setSellerId(sellerid1);
			sellerProductDto1.setProductInfos(productInfos1);	
			
			int sellerid2 = TestDataManager.getRandomIntNum(6);		
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid2);

			createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBeanForExcludeProduct(sellerid2, PromotionTypeEnum.ReduceIfCountEnough);

			List<String> productIds = new ArrayList<>();
			
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(8);

			productIds.add(bpw.get(4).get("ProductId").toString());
			productIds.add(bpw.get(5).get("ProductId").toString());
			productIds.add(bpw.get(6).get("ProductId").toString());
			productIds.add(bpw.get(7).get("ProductId").toString());
			
			createSellerPromotionBean.getPromotionInfo().setProductIds(productIds);
			
			int promotionId2 = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);
								
			ProductDto productDto4 = new ProductDto();
			
			productDto4.setProductId(createSellerPromotionBean.getPromotionInfo().getProductIds().get(0));
			productDto4.setCatalogId(TestDataManager.getRandomNum(6));
			productDto4.setProductUnitPrice(new BigDecimal(5));
			productDto4.setProductQty(2);	
			
			ProductDto productDto5 = new ProductDto();
			
			productDto5.setProductId(createSellerPromotionBean.getPromotionInfo().getProductIds().get(2));
			productDto5.setCatalogId(TestDataManager.getRandomNum(6));
			productDto5.setProductUnitPrice(new BigDecimal(10));
			productDto5.setProductQty(1);
			
			ProductDto productDto6 = new ProductDto();
			
			productDto6.setProductId(TestDataManager.getRandomNum(20));
			productDto6.setCatalogId(TestDataManager.getRandomNum(6));
			productDto6.setProductUnitPrice(new BigDecimal(5));
			productDto6.setProductQty(2);
			
			List<ProductDto> productInfos2 = new ArrayList<>();
			productInfos2.add(productDto4);
			productInfos2.add(productDto5);
			productInfos2.add(productDto6);

			SellerProductDto sellerProductDto2 = new SellerProductDto();
			sellerProductDto2.setSellerId(sellerid2);
			sellerProductDto2.setProductInfos(productInfos2);			
			
			List<SellerProductDto> sellerProducts = new ArrayList<>();
			sellerProducts.add(sellerProductDto1);
			sellerProducts.add(sellerProductDto2);

			getsellerpromotioninfobyproductidsBean.setBuyerId(buyerid);
			getsellerpromotioninfobyproductidsBean.setSellerProductInfos(sellerProducts);
			
			getsellerpromotioninfobyproductidsCall.setData(getsellerpromotioninfobyproductidsBean);
			getsellerpromotioninfobyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getsellerpromotioninfobyproductidsCall.getCode(), "验证返回Code");
			
			ShoppingCartCalculateResp sellerProductsPromotionInfos = getsellerpromotioninfobyproductidsCall.getShoppingCartCalculateResp();
			List<ShoppingCartSellerPromotionDto>  shoppingCartSellerPromotions = sellerProductsPromotionInfos.getSellerProductsPromotionInfos();
			
			for(int j=0;j<shoppingCartSellerPromotions.size();j++)
			{
			Logger.verifyEquals(getsellerpromotioninfobyproductidsBean.getSellerProductInfos().get(j).getSellerId(), sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(j).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto validProductPromotionInfoDto = sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(j).getValidPromotionInfos().get(0);
			
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(validProductPromotionInfoDto.getPromotionPolicyInfo(),false);
			Logger.verifyEquals(createSellerPromotionBean.getPromotionInfo().getPromotionValues().get(0).getValue(), validProductPromotionInfoDto.getPromotionAmount(), "验证返回PromotionAmount");
			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getInvalidPromotionInfos().size(),"验证InvalidPromotionInfos空");
			}
			
			List<ProductDto> returnProductDtos1 = shoppingCartSellerPromotions.get(0).getValidPromotionInfos().get(0).getProductInfos();
			Logger.verifyEquals(productDto2.getProductId(), returnProductDtos1.get(0).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto2.getCatalogId(), returnProductDtos1.get(0).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto2.getProductUnitPrice(), returnProductDtos1.get(0).getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto2.getProductQty(), returnProductDtos1.get(0).getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto2.getProductUnitPrice().multiply(new BigDecimal(productDto2.getProductQty())), returnProductDtos1.get(0).getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, returnProductDtos1.get(0).getPromotionValue().compareTo(BigDecimal.valueOf(0.2)), "验证返回PromotionValue");
		
			Logger.verifyEquals(productDto3.getProductId(), returnProductDtos1.get(1).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto3.getCatalogId(), returnProductDtos1.get(1).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto3.getProductUnitPrice(), returnProductDtos1.get(1).getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto3.getProductQty(), returnProductDtos1.get(1).getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto3.getProductUnitPrice().multiply(new BigDecimal(productDto3.getProductQty())), returnProductDtos1.get(1).getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, returnProductDtos1.get(1).getPromotionValue().compareTo(BigDecimal.valueOf(0.8)), "验证返回PromotionValue");
		
			List<ProductDto> returnProductDtos2 = shoppingCartSellerPromotions.get(1).getValidPromotionInfos().get(0).getProductInfos();
			Logger.verifyEquals(productDto6.getProductId(), returnProductDtos2.get(0).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto6.getCatalogId(), returnProductDtos2.get(0).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto6.getProductUnitPrice(), returnProductDtos2.get(0).getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto6.getProductQty(), returnProductDtos2.get(0).getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto6.getProductUnitPrice().multiply(new BigDecimal(productDto6.getProductQty())), returnProductDtos2.get(0).getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, returnProductDtos2.get(0).getPromotionValue().compareTo(BigDecimal.valueOf(1)), "验证返回PromotionValue");
		
			// 验证NonProductPromotionInfos
			List<ProductDto> returnProductDtos3 = shoppingCartSellerPromotions.get(0).getNonProductPromotionInfos().get(0).getProductInfos();
			Logger.verifyEquals(productDto1.getProductId(), returnProductDtos3.get(0).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto1.getCatalogId(), returnProductDtos3.get(0).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto1.getProductUnitPrice(), returnProductDtos3.get(0).getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto1.getProductQty(), returnProductDtos3.get(0).getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto1.getProductUnitPrice().multiply(new BigDecimal(productDto1.getProductQty())), returnProductDtos3.get(0).getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, returnProductDtos3.get(0).getPromotionValue().compareTo(BigDecimal.valueOf(0)), "验证返回PromotionValue");
		
			List<ProductDto> returnProductDtos4 = shoppingCartSellerPromotions.get(1).getNonProductPromotionInfos().get(0).getProductInfos();
			Logger.verifyEquals(productDto4.getProductId(), returnProductDtos4.get(0).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto4.getCatalogId(), returnProductDtos4.get(0).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto4.getProductUnitPrice(), returnProductDtos4.get(0).getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto4.getProductQty(), returnProductDtos4.get(0).getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto4.getProductUnitPrice().multiply(new BigDecimal(productDto4.getProductQty())), returnProductDtos4.get(0).getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, returnProductDtos4.get(0).getPromotionValue().compareTo(BigDecimal.valueOf(0)), "验证返回PromotionValue");
		
			Logger.verifyEquals(productDto5.getProductId(), returnProductDtos4.get(1).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto5.getCatalogId(), returnProductDtos4.get(1).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto5.getProductUnitPrice(), returnProductDtos4.get(1).getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto5.getProductQty(), returnProductDtos4.get(1).getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto5.getProductUnitPrice().multiply(new BigDecimal(productDto5.getProductQty())), returnProductDtos4.get(1).getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, returnProductDtos4.get(1).getPromotionValue().compareTo(BigDecimal.valueOf(0)), "验证返回PromotionValue");
		
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetSellerPromotionInfoByProductIds_027() {
		Logger.start(true,"购物车计算商品促销信息-根据商品Id集合获取商品促销信息-排除商品-多个商家-多件商品-部分商品满足条件-满金额折");
		try {
			int buyerid = TestDataManager.getRandomIntNum(6);			

			int sellerid1 = TestDataManager.getRandomIntNum(6);		
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid1);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBeanForExcludeProduct(sellerid1, PromotionTypeEnum.DiscountIfAmountEnough);
			int promotionId = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);
								
			ProductDto productDto1 = new ProductDto();
			
			productDto1.setProductId(createSellerPromotionBean.getPromotionInfo().getProductIds().get(0));
			productDto1.setCatalogId(TestDataManager.getRandomNum(6));
			productDto1.setProductUnitPrice(new BigDecimal(5));
			productDto1.setProductQty(2);	
			
			ProductDto productDto2 = new ProductDto();
			
			productDto2.setProductId(TestDataManager.getRandomNum(20));
			productDto2.setCatalogId(TestDataManager.getRandomNum(6));
			productDto2.setProductUnitPrice(new BigDecimal(5));
			productDto2.setProductQty(1);
			
			ProductDto productDto3 = new ProductDto();
			
			productDto3.setProductId(TestDataManager.getRandomNum(20));
			productDto3.setCatalogId(TestDataManager.getRandomNum(6));
			productDto3.setProductUnitPrice(new BigDecimal(3));
			productDto3.setProductQty(2);
			
			List<ProductDto> productInfos1 = new ArrayList<>();
			productInfos1.add(productDto1);
			productInfos1.add(productDto2);
			productInfos1.add(productDto3);

			SellerProductDto sellerProductDto1 = new SellerProductDto();
			sellerProductDto1.setSellerId(sellerid1);
			sellerProductDto1.setProductInfos(productInfos1);	
			
			int sellerid2 = TestDataManager.getRandomIntNum(6);		
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid2);

			createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBeanForExcludeProduct(sellerid2, PromotionTypeEnum.DiscountIfAmountEnough);
			createSellerPromotionBean.getPromotionInfo().getPromotionValues().get(0).setQtyCondition(3);

			List<String> productIds = new ArrayList<>();
			
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(8);

			productIds.add(bpw.get(4).get("ProductId").toString());
			productIds.add(bpw.get(5).get("ProductId").toString());
			productIds.add(bpw.get(6).get("ProductId").toString());
			productIds.add(bpw.get(7).get("ProductId").toString());
			
			createSellerPromotionBean.getPromotionInfo().setProductIds(productIds);
			
			int promotionId2 = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);
																
			ProductDto productDto4 = new ProductDto();
			
			productDto4.setProductId(createSellerPromotionBean.getPromotionInfo().getProductIds().get(0));
			productDto4.setCatalogId(TestDataManager.getRandomNum(6));
			productDto4.setProductUnitPrice(new BigDecimal(5));
			productDto4.setProductQty(2);	
			
			ProductDto productDto5 = new ProductDto();
			
			productDto5.setProductId(createSellerPromotionBean.getPromotionInfo().getProductIds().get(2));
			productDto5.setCatalogId(TestDataManager.getRandomNum(6));
			productDto5.setProductUnitPrice(new BigDecimal(10));
			productDto5.setProductQty(1);
			
			ProductDto productDto6 = new ProductDto();
			
			productDto6.setProductId(TestDataManager.getRandomNum(20));
			productDto6.setCatalogId(TestDataManager.getRandomNum(6));
			productDto6.setProductUnitPrice(new BigDecimal(4));
			productDto6.setProductQty(2);
			
			List<ProductDto> productInfos2 = new ArrayList<>();
			productInfos2.add(productDto4);
			productInfos2.add(productDto5);
			productInfos2.add(productDto6);

			SellerProductDto sellerProductDto2 = new SellerProductDto();
			sellerProductDto2.setSellerId(sellerid2);
			sellerProductDto2.setProductInfos(productInfos2);			
			
			List<SellerProductDto> sellerProducts = new ArrayList<>();
			sellerProducts.add(sellerProductDto1);
			sellerProducts.add(sellerProductDto2);

			getsellerpromotioninfobyproductidsBean.setBuyerId(buyerid);
			getsellerpromotioninfobyproductidsBean.setSellerProductInfos(sellerProducts);
			
			getsellerpromotioninfobyproductidsCall.setData(getsellerpromotioninfobyproductidsBean);
			getsellerpromotioninfobyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getsellerpromotioninfobyproductidsCall.getCode(), "验证返回Code");
			
			ShoppingCartCalculateResp sellerProductsPromotionInfos = getsellerpromotioninfobyproductidsCall.getShoppingCartCalculateResp();
			List<ShoppingCartSellerPromotionDto>  shoppingCartSellerPromotions = sellerProductsPromotionInfos.getSellerProductsPromotionInfos();
			
			for(int j=0;j<shoppingCartSellerPromotions.size();j++)
			{
			Logger.verifyEquals(getsellerpromotioninfobyproductidsBean.getSellerProductInfos().get(j).getSellerId(), sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(j).getSellerId(), "验证返回SellerId");
			}
			
			ProductPromotionInfoDto validProductPromotionInfoDto = sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getValidPromotionInfos().get(0);
			
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(validProductPromotionInfoDto.getPromotionPolicyInfo(),false);
			Logger.verifyEquals(0, validProductPromotionInfoDto.getPromotionAmount().compareTo(BigDecimal.valueOf(9.9)), "验证返回PromotionAmount");
			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getInvalidPromotionInfos().size(),"验证InvalidPromotionInfos空");
		
			validProductPromotionInfoDto = sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(1).getInvalidPromotionInfos().get(0);
			
			promotionInfoVerify.verifyPromotionPolicyInDB(validProductPromotionInfoDto.getPromotionPolicyInfo(),false);
			Logger.verifyEquals(0, validProductPromotionInfoDto.getPromotionAmount().compareTo(BigDecimal.valueOf(0)), "验证返回PromotionAmount");
			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(1).getValidPromotionInfos().size(),"验证InvalidPromotionInfos空");
		
			List<ProductDto> returnProductDtos1 = shoppingCartSellerPromotions.get(0).getValidPromotionInfos().get(0).getProductInfos();
			Logger.verifyEquals(productDto2.getProductId(), returnProductDtos1.get(0).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto2.getCatalogId(), returnProductDtos1.get(0).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto2.getProductUnitPrice(), returnProductDtos1.get(0).getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto2.getProductQty(), returnProductDtos1.get(0).getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto2.getProductUnitPrice().multiply(new BigDecimal(productDto2.getProductQty())), returnProductDtos1.get(0).getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, returnProductDtos1.get(0).getPromotionValue().compareTo(BigDecimal.valueOf(4.5)), "验证返回PromotionValue");
		
			Logger.verifyEquals(productDto3.getProductId(), returnProductDtos1.get(1).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto3.getCatalogId(), returnProductDtos1.get(1).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto3.getProductUnitPrice(), returnProductDtos1.get(1).getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto3.getProductQty(), returnProductDtos1.get(1).getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto3.getProductUnitPrice().multiply(new BigDecimal(productDto3.getProductQty())), returnProductDtos1.get(1).getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, returnProductDtos1.get(1).getPromotionValue().compareTo(BigDecimal.valueOf(5.4)), "验证返回PromotionValue");
		
			List<ProductDto> returnProductDtos2 = shoppingCartSellerPromotions.get(1).getInvalidPromotionInfos().get(0).getProductInfos();
			Logger.verifyEquals(productDto6.getProductId(), returnProductDtos2.get(0).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto6.getCatalogId(), returnProductDtos2.get(0).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto6.getProductUnitPrice(), returnProductDtos2.get(0).getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto6.getProductQty(), returnProductDtos2.get(0).getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto6.getProductUnitPrice().multiply(new BigDecimal(productDto6.getProductQty())), returnProductDtos2.get(0).getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, returnProductDtos2.get(0).getPromotionValue().compareTo(BigDecimal.valueOf(0)), "验证返回PromotionValue");
		
			// 验证NonProductPromotionInfos
			List<ProductDto> returnProductDtos3 = shoppingCartSellerPromotions.get(0).getNonProductPromotionInfos().get(0).getProductInfos();
			Logger.verifyEquals(productDto1.getProductId(), returnProductDtos3.get(0).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto1.getCatalogId(), returnProductDtos3.get(0).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto1.getProductUnitPrice(), returnProductDtos3.get(0).getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto1.getProductQty(), returnProductDtos3.get(0).getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto1.getProductUnitPrice().multiply(new BigDecimal(productDto1.getProductQty())), returnProductDtos3.get(0).getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, returnProductDtos3.get(0).getPromotionValue().compareTo(BigDecimal.valueOf(0)), "验证返回PromotionValue");
		
			List<ProductDto> returnProductDtos4 = shoppingCartSellerPromotions.get(1).getNonProductPromotionInfos().get(0).getProductInfos();
			Logger.verifyEquals(productDto4.getProductId(), returnProductDtos4.get(0).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto4.getCatalogId(), returnProductDtos4.get(0).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto4.getProductUnitPrice(), returnProductDtos4.get(0).getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto4.getProductQty(), returnProductDtos4.get(0).getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto4.getProductUnitPrice().multiply(new BigDecimal(productDto4.getProductQty())), returnProductDtos4.get(0).getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, returnProductDtos4.get(0).getPromotionValue().compareTo(BigDecimal.valueOf(0)), "验证返回PromotionValue");
		
			Logger.verifyEquals(productDto5.getProductId(), returnProductDtos4.get(1).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto5.getCatalogId(), returnProductDtos4.get(1).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto5.getProductUnitPrice(), returnProductDtos4.get(1).getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto5.getProductQty(), returnProductDtos4.get(1).getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto5.getProductUnitPrice().multiply(new BigDecimal(productDto5.getProductQty())), returnProductDtos4.get(1).getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, returnProductDtos4.get(1).getPromotionValue().compareTo(BigDecimal.valueOf(0)), "验证返回PromotionValue");
		
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	

	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetSellerPromotionInfoByProductIds_028() {
		Logger.start(true,"购物车计算商品促销信息-根据商品Id集合获取商品促销信息-排除商品-多个商家-多件商品-部分商品满足条件-第二件半价");
		try {
			int buyerid = TestDataManager.getRandomIntNum(6);			

			int sellerid1 = TestDataManager.getRandomIntNum(6);		
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid1);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBeanForExcludeProduct(sellerid1, PromotionTypeEnum.HalfIfCountEnough);
			int promotionId = JSellerPromotionCallService.CreateOldSellerPromotion(createSellerPromotionBean);
								
			ProductDto productDto1 = new ProductDto();
			
			productDto1.setProductId(createSellerPromotionBean.getPromotionInfo().getProductIds().get(0));
			productDto1.setCatalogId(TestDataManager.getRandomNum(6));
			productDto1.setProductUnitPrice(new BigDecimal(5));
			productDto1.setProductQty(2);	
			
			ProductDto productDto2 = new ProductDto();
			
			productDto2.setProductId(TestDataManager.getRandomNum(20));
			productDto2.setCatalogId(TestDataManager.getRandomNum(6));
			productDto2.setProductUnitPrice(new BigDecimal(5));
			productDto2.setProductQty(1);
			
			ProductDto productDto3 = new ProductDto();
			
			productDto3.setProductId(TestDataManager.getRandomNum(20));
			productDto3.setCatalogId(TestDataManager.getRandomNum(6));
			productDto3.setProductUnitPrice(new BigDecimal(3));
			productDto3.setProductQty(2);
			
			List<ProductDto> productInfos1 = new ArrayList<>();
			productInfos1.add(productDto1);
			productInfos1.add(productDto2);
			productInfos1.add(productDto3);

			SellerProductDto sellerProductDto1 = new SellerProductDto();
			sellerProductDto1.setSellerId(sellerid1);
			sellerProductDto1.setProductInfos(productInfos1);	
			
			int sellerid2 = TestDataManager.getRandomIntNum(6);		
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid2);

			createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBeanForExcludeProduct(sellerid2, PromotionTypeEnum.HalfIfCountEnough);
			createSellerPromotionBean.getPromotionInfo().getPromotionValues().get(0).setQtyCondition(3);

			List<String> productIds = new ArrayList<>();
			
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(8);

			productIds.add(bpw.get(4).get("ProductId").toString());
			productIds.add(bpw.get(5).get("ProductId").toString());
			productIds.add(bpw.get(6).get("ProductId").toString());
			productIds.add(bpw.get(7).get("ProductId").toString());
			
			createSellerPromotionBean.getPromotionInfo().setProductIds(productIds);
			
			int promotionId2 = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);
																
			ProductDto productDto4 = new ProductDto();
			
			productDto4.setProductId(createSellerPromotionBean.getPromotionInfo().getProductIds().get(0));
			productDto4.setCatalogId(TestDataManager.getRandomNum(6));
			productDto4.setProductUnitPrice(new BigDecimal(5));
			productDto4.setProductQty(2);	
			
			ProductDto productDto5 = new ProductDto();
			
			productDto5.setProductId(createSellerPromotionBean.getPromotionInfo().getProductIds().get(2));
			productDto5.setCatalogId(TestDataManager.getRandomNum(6));
			productDto5.setProductUnitPrice(new BigDecimal(10));
			productDto5.setProductQty(1);
			
			ProductDto productDto6 = new ProductDto();
			
			productDto6.setProductId(TestDataManager.getRandomNum(20));
			productDto6.setCatalogId(TestDataManager.getRandomNum(6));
			productDto6.setProductUnitPrice(new BigDecimal(4));
			productDto6.setProductQty(3);
			
			List<ProductDto> productInfos2 = new ArrayList<>();
			productInfos2.add(productDto4);
			productInfos2.add(productDto5);
			productInfos2.add(productDto6);

			SellerProductDto sellerProductDto2 = new SellerProductDto();
			sellerProductDto2.setSellerId(sellerid2);
			sellerProductDto2.setProductInfos(productInfos2);			
			
			List<SellerProductDto> sellerProducts = new ArrayList<>();
			sellerProducts.add(sellerProductDto1);
			sellerProducts.add(sellerProductDto2);

			getsellerpromotioninfobyproductidsBean.setBuyerId(buyerid);
			getsellerpromotioninfobyproductidsBean.setSellerProductInfos(sellerProducts);
			
			getsellerpromotioninfobyproductidsCall.setData(getsellerpromotioninfobyproductidsBean);
			getsellerpromotioninfobyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getsellerpromotioninfobyproductidsCall.getCode(), "验证返回Code");
			
			ShoppingCartCalculateResp sellerProductsPromotionInfos = getsellerpromotioninfobyproductidsCall.getShoppingCartCalculateResp();
			List<ShoppingCartSellerPromotionDto>  shoppingCartSellerPromotions = sellerProductsPromotionInfos.getSellerProductsPromotionInfos();
			
			for(int j=0;j<shoppingCartSellerPromotions.size();j++)
			{
			Logger.verifyEquals(getsellerpromotioninfobyproductidsBean.getSellerProductInfos().get(j).getSellerId(), sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(j).getSellerId(), "验证返回SellerId");
			}
			
			// 返回顺序变来变去，没法验
//			ProductPromotionInfoDto validProductPromotionInfoDto = sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getValidPromotionInfos().get(0);
//			
//			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
//			promotionInfoVerify.verifyPromotionPolicyInDB(validProductPromotionInfoDto.getPromotionPolicyInfo(),false);
//			Logger.verifyEquals(0, validProductPromotionInfoDto.getPromotionAmount().compareTo(BigDecimal.valueOf(1.5)), "验证返回PromotionAmount");
//			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0).getInvalidPromotionInfos().size(),"验证InvalidPromotionInfos空");
//		
//			validProductPromotionInfoDto = sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(1).getValidPromotionInfos().get(0);
//			
//			promotionInfoVerify.verifyPromotionPolicyInDB(validProductPromotionInfoDto.getPromotionPolicyInfo(),false);
//			Logger.verifyEquals(0, validProductPromotionInfoDto.getPromotionAmount().compareTo(BigDecimal.valueOf(2)), "验证返回PromotionAmount");
//			Logger.verifyEquals(0,sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(1).getInvalidPromotionInfos().size(),"验证InvalidPromotionInfos空");
//		
//			List<ProductDto> returnProductDtos1 = shoppingCartSellerPromotions.get(0).getValidPromotionInfos().get(0).getProductInfos();
//			Logger.verifyEquals(productDto3.getProductId(), returnProductDtos1.get(0).getProductId(), "验证返回ProductId");
//			Logger.verifyEquals(productDto3.getCatalogId(), returnProductDtos1.get(0).getCatalogId(), "验证返回CatalogId");
//			Logger.verifyEquals(productDto3.getProductUnitPrice(), returnProductDtos1.get(0).getProductUnitPrice(), "验证返回ProductUnitPrice");
//			Logger.verifyEquals(productDto3.getProductQty(), returnProductDtos1.get(0).getProductQty(), "验证返回ProductQty");
//			Logger.verifyEquals(productDto3.getProductUnitPrice().multiply(new BigDecimal(productDto3.getProductQty())), returnProductDtos1.get(0).getProductTotalPrice(), "验证返回ProductTotalPrice");
//			Logger.verifyEquals(0, returnProductDtos1.get(0).getPromotionValue().compareTo(BigDecimal.valueOf(1.5)), "验证返回PromotionValue");
//		
//			Logger.verifyEquals(productDto2.getProductId(), returnProductDtos1.get(1).getProductId(), "验证返回ProductId");
//			Logger.verifyEquals(productDto2.getCatalogId(), returnProductDtos1.get(1).getCatalogId(), "验证返回CatalogId");
//			Logger.verifyEquals(productDto2.getProductUnitPrice(), returnProductDtos1.get(1).getProductUnitPrice(), "验证返回ProductUnitPrice");
//			Logger.verifyEquals(productDto2.getProductQty(), returnProductDtos1.get(1).getProductQty(), "验证返回ProductQty");
//			Logger.verifyEquals(productDto2.getProductUnitPrice().multiply(new BigDecimal(productDto2.getProductQty())), returnProductDtos1.get(1).getProductTotalPrice(), "验证返回ProductTotalPrice");
//			Logger.verifyEquals(0, returnProductDtos1.get(1).getPromotionValue().compareTo(BigDecimal.valueOf(0)), "验证返回PromotionValue");
//		
//			List<ProductDto> returnProductDtos2 = shoppingCartSellerPromotions.get(1).getValidPromotionInfos().get(0).getProductInfos();
//			Logger.verifyEquals(productDto6.getProductId(), returnProductDtos2.get(0).getProductId(), "验证返回ProductId");
//			Logger.verifyEquals(productDto6.getCatalogId(), returnProductDtos2.get(0).getCatalogId(), "验证返回CatalogId");
//			Logger.verifyEquals(productDto6.getProductUnitPrice(), returnProductDtos2.get(0).getProductUnitPrice(), "验证返回ProductUnitPrice");
//			Logger.verifyEquals(productDto6.getProductQty(), returnProductDtos2.get(0).getProductQty(), "验证返回ProductQty");
//			Logger.verifyEquals(productDto6.getProductUnitPrice().multiply(new BigDecimal(productDto6.getProductQty())), returnProductDtos2.get(0).getProductTotalPrice(), "验证返回ProductTotalPrice");
//			Logger.verifyEquals(0, returnProductDtos2.get(0).getPromotionValue().compareTo(BigDecimal.valueOf(2)), "验证返回PromotionValue");
		
			// 验证NonProductPromotionInfos
			List<ProductDto> returnProductDtos3 = shoppingCartSellerPromotions.get(0).getNonProductPromotionInfos().get(0).getProductInfos();
			Logger.verifyEquals(productDto1.getProductId(), returnProductDtos3.get(0).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto1.getCatalogId(), returnProductDtos3.get(0).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto1.getProductUnitPrice(), returnProductDtos3.get(0).getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto1.getProductQty(), returnProductDtos3.get(0).getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto1.getProductUnitPrice().multiply(new BigDecimal(productDto1.getProductQty())), returnProductDtos3.get(0).getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, returnProductDtos3.get(0).getPromotionValue().compareTo(BigDecimal.valueOf(0)), "验证返回PromotionValue");
		
			List<ProductDto> returnProductDtos4 = shoppingCartSellerPromotions.get(1).getNonProductPromotionInfos().get(0).getProductInfos();
			Logger.verifyEquals(productDto4.getProductId(), returnProductDtos4.get(0).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto4.getCatalogId(), returnProductDtos4.get(0).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto4.getProductUnitPrice(), returnProductDtos4.get(0).getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto4.getProductQty(), returnProductDtos4.get(0).getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto4.getProductUnitPrice().multiply(new BigDecimal(productDto4.getProductQty())), returnProductDtos4.get(0).getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, returnProductDtos4.get(0).getPromotionValue().compareTo(BigDecimal.valueOf(0)), "验证返回PromotionValue");
		
			Logger.verifyEquals(productDto5.getProductId(), returnProductDtos4.get(1).getProductId(), "验证返回ProductId");
			Logger.verifyEquals(productDto5.getCatalogId(), returnProductDtos4.get(1).getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(productDto5.getProductUnitPrice(), returnProductDtos4.get(1).getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(productDto5.getProductQty(), returnProductDtos4.get(1).getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(productDto5.getProductUnitPrice().multiply(new BigDecimal(productDto5.getProductQty())), returnProductDtos4.get(1).getProductTotalPrice(), "验证返回ProductTotalPrice");
			Logger.verifyEquals(0, returnProductDtos4.get(1).getPromotionValue().compareTo(BigDecimal.valueOf(0)), "验证返回PromotionValue");
		
			String url = getsellerpromotioninfobyproductidsCall.getUrl();
			url=url.replace("reachpromotion.iapi.ymatou.com", "sellerpromotion.api.ymatou.com");
		
			getsellerpromotioninfobyproductidsCall.setUrl(url);
			
			getsellerpromotioninfobyproductidsCall.callService();				
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	@Ignore
	public void Tc_GetSellerPromotionInfoByProductIds_029() {
		Logger.start(true,"购物车计算商品促销信息-根据商品Id集合获取商品促销信息-新老接口对比");
		try {
			int buyerid = TestDataManager.getRandomIntNum(6);			

			int sellerid = 3207973;			
		
			ProductDto productDto = new ProductDto();
						
			String productId="4a1c7bb7-195c-469c-a44f-8e3b45e8f3e8";
			productDto.setProductId(productId);
			productDto.setCatalogId(TestDataManager.getRandomNum(6));
			productDto.setProductUnitPrice(new BigDecimal(10));
			productDto.setProductQty(2);		
			
			ProductDto productDto1 = new ProductDto();
			String productId1="bfac4426-6059-4806-8a63-8a8e09c598e1";
			productDto1.setProductId(productId1);
			productDto1.setCatalogId(TestDataManager.getRandomNum(6));
			productDto1.setProductUnitPrice(new BigDecimal(6));
			productDto1.setProductQty(2);	
			
			ProductDto productDto2 = new ProductDto();
			String productId2="4a1c7bb7-195c-469c-a44f-8a8e09c598e1";
			productDto2.setProductId(productId2);
			productDto2.setCatalogId(TestDataManager.getRandomNum(6));
			productDto2.setProductUnitPrice(new BigDecimal(4));
			productDto2.setProductQty(2);	
			
			List<ProductDto> productInfos = new ArrayList<>();
			productInfos.add(productDto);
			productInfos.add(productDto1);
			productInfos.add(productDto2);
			
			SellerProductDto sellerProductDto = new SellerProductDto();
			sellerProductDto.setSellerId(sellerid);
			sellerProductDto.setProductInfos(productInfos);					
			
			List<SellerProductDto> sellerProducts = new ArrayList<>();
			sellerProducts.add(sellerProductDto);
			
			getsellerpromotioninfobyproductidsBean.setBuyerId(buyerid);
			getsellerpromotioninfobyproductidsBean.setSellerProductInfos(sellerProducts);
			
			getsellerpromotioninfobyproductidsCall.setData(getsellerpromotioninfobyproductidsBean);
			getsellerpromotioninfobyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getsellerpromotioninfobyproductidsCall.getCode(), "验证返回Code");
			
			ShoppingCartCalculateResp sellerProductsPromotionInfos = getsellerpromotioninfobyproductidsCall.getShoppingCartCalculateResp();
		
			String url = getsellerpromotioninfobyproductidsCall.getUrl();
			url=url.replace("reachpromotion.iapi.ymatou.com", "sellerpromotion.api.ymatou.com");
		
			getsellerpromotioninfobyproductidsCall.setUrl(url);
			
			getsellerpromotioninfobyproductidsCall.callService();				
			
			ShoppingCartCalculateResp sellerProductsPromotionInfos2 = getsellerpromotioninfobyproductidsCall.getShoppingCartCalculateResp();
			
			AssertHelper.assertResultEqual(sellerProductsPromotionInfos.getSellerProductsPromotionInfos().get(0), sellerProductsPromotionInfos2.getSellerProductsPromotionInfos().get(0), "GetSellerPromotionInfoByProductIds");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

}